https://github.com/ryandaniels/ansible-role-create-users
Manage users on Linux using Ansible
https://github.com/ryandaniels/ansible-role-create-users
ansible ansible-role
Last synced: 6 months ago
JSON representation
Manage users on Linux using Ansible
- Host: GitHub
- URL: https://github.com/ryandaniels/ansible-role-create-users
- Owner: ryandaniels
- License: mit
- Created: 2017-02-14T04:44:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-02-20T03:49:53.000Z (8 months ago)
- Last Synced: 2025-03-28T23:09:02.500Z (7 months ago)
- Topics: ansible, ansible-role
- Homepage: https://galaxy.ansible.com/ryandaniels/create_users
- Size: 61.5 KB
- Stars: 105
- Watchers: 6
- Forks: 58
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ansible-role-create-users
[](https://github.com/ryandaniels/ansible-role-create-users/actions?query=workflow%3ACI)
Role to manage users on linux.
Manage users in the user list config file (list is in the file vars/secret).
Add users (with specific uid), change passwords, lock/unlock user accounts, manage sudo access (per user), add ssh key(s) for sshkey based authentication, set user's primary group and gid, add user (append) to group(s) and group will be created if doesn't exist.
This is done on a per "group" basis (Ansible group variables), as set in the config file. The group comes from the Ansible group as set for a server in the inventory file.
`all` is also supported to apply to every host in an inventory file.
Special variable `inventory_hostname` is also supported to apply to just one server in an inventory file.More detailed example can be found in the blog post: [User Management with Ansible](https://ryandaniels.ca/blog/ansible-user-management/)
Note: Deleting users is not done on purpose.
## Distros tested
* Ubuntu 24.04, 22.04, 20.04, 18.04, 16.04
* CentOS / RHEL: 9.1, 8.x, 7.x, 6.5, 5.9## Dependencies
Requires Ansible >2.9. Test on Ansible 2.16 (versions of this Ansible Role `>=v2`).
If Ansible 2.9 is required, the branch `ansible29` still works (versions of this Ansible Role `