Ansible Playbook 简单示例
给远程机器添加用户
Ansbile命令:
# ansible elk06 -m user -a "name=elastic uid=4000 state=present"
PlayBook(YAML):
# ansible-playbook user.yml # cat user.yml --- - name: Configure important user consistently hosts: elk06 tasks: - name: elastic exists with UID 5000 user: name: elastic uid: 4000 state: present