adduser
ansible-role-adduser
Example Playbook
- hosts: all
roles:
- grokon.adduser
vars:
adduser__groups:
- name: "foo"
gid: 3001
sudo: /usr/bin/sudo
adduser__users:
- name: "boo"
groups: ["foo"]
ssh_key: ["ssh-rsa blahblahblah"]
shell: "/bin/bash"
uid: 3000
home: "/home/foo"
system: true
An Ansible Role that added users and groups on Debian
Table of content
Default Variables
adduser__authorized_keys_file
The file to store authorized keys in
Default value
adduser__authorized_keys_file: .ssh/authorized_keys
adduser__create_homedir
Create home dirs for new users? Set this to false if you manage home directories in some other way.
Default value
adduser__create_homedir: true
adduser__create_per_user_group
Create a group for every user and make that their primary group
Default value
adduser__create_per_user_group: true
adduser__default_group
Default value
adduser__default_group: users
adduser__default_shell
The default shell for a user if none is specified
Default value
adduser__default_shell: /bin/bash
adduser__delete_unmanaged
Delete users and groups that are not managed by ansible
Default value
adduser__delete_unmanaged: true
adduser__docker_group
The group to add users to docker group is docker is installed and this is set to true
Default value
adduser__docker_group: docker
adduser__group
If we're not creating a per-user group, then this is the group all users belong to
adduser__groups
List of groups to create
Default value
adduser__groups: []
Example usage
adduser__groups_to_create:
- name: "foo"
gid: 1000
- name: "bar"
gid: 1001
adduser__remove_home
Delete the home directory of a user when the user is removed?
Default value
adduser__remove_home: false
adduser__stats_file_path
Default value
adduser__stats_file_path: ~/.ansible
adduser__user_stats_file
The file to store user stats in
adduser__users
List of users to create
Default value
adduser__users: []
Example usage
adduser__users:
- name: "foo"
group: ["foo", "bar"]
ssh_key: ['ssh-rsa blahblahblah']
shell: "/bin/bash"
uid: 1000
home: "/home/foo"
is_system_user: true
docker_group: true
Discovered Tags
adduser
groups
users
Open Tasks
Dependencies
None.
License
MIT
Author
grokon