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

  



posted @ 2021-10-12 18:22  Lambeto  阅读(165)  评论(0编辑  收藏  举报