Ansible version: 2.9.7
Lists users on hosts
ansible-playbook ./list_users.yml
Add User(s)
Required:
- name: example_username
web_app_users:
- { name: user1, create_home: yes, comment: "test 1" }
Remove User(s)
Required:
- state: absent
- remove: yes
web_app_users:
- { name: user1, create_home: yes, comment: "test 1", state: absent, remove: yes, pubKey: "..." }
Sync Users (run updates, additions, deletions)
ansible-playbook ./update_users.yml -e @./users/vars.yml