Ansible Role: users
linconf.users allows you to configure users and groups in an organized manner.
For simple or one-off cases see the Ansible user module.
Run the following command to install from Ansible Galaxy.
ansible-galaxy install linconf.users
The latest stable release of Ansible is assumed, however most LinConf roles will run on earlier versions as well.
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'
Password hash created using:
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
groups: option of
users_accounts) you must also use
add the group to the system.
All variables are optional.
users_system_uid: False- All users without specified uids will receive uids less than 1000 per convention.
users_accounts: - Expects a list of users to add, only name: is required.
option:- see Ansible user module for options
users_groups: - Expects a list of groups to add
option:- see Ansible group module for options
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.
--skip-tags parameters allows the execution
of only parts of certain roles.
users- Primary role tag, executes all role tasks
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.
Author and License
Released under the MIT License