An Ansible role that manages users and groups on Debian/Ubuntu and RHEL/CentOS.
ansible-galaxy install linconf.users
Add a User
- hosts: localhost
roles:
- linconf.users
vars:
users_accounts:
- name: 'NewUser'
group: 'NewUser'
# Additional Groups
groups: ['wheel', 'users']
password: '$6$c6pQJ3kzW80oZwTi$...'
update_password: 'always'
See the Ansible user module for a full list of available options.
Password hash created using: mkpasswd --method=SHA-512
Remove a User
users_accounts:
- name: 'NewUser'
state: absent
Add a Group
users_groups:
- name: 'NewGroup'
Whenever you add a user to a group that doesn't yet exist on the system (using
the groups:
option of users_accounts
) you must also use users_groups
to
add the group to the system.
Additional Options
See the linconf.users documentation for a full list of available options.
Optionally, this role has 3 lists for users, and 3 lists for groups. This can be useful in situations where groups of hosts share the same users.
users_accounts: []
users_host_accounts: []
users_group_accounts: []
users_groups: []
users_host_groups: []
users_group_groups: []
- None
The master branch is continuously validated by Travis-CI.
Minor versions indicate the role passed local testing as described by the
.kitchen
declaration. Instructions for performing test-kitchen runs locally
are detailed in the LinConf Documentation.
Chad Sheets - GitHub | Blog | Email
Released under the MIT License