Manage system user accounts and groups. Tested on RedHat/CentOS or Debian/Ubuntu but should work for most Linux distributions / flavours.
None
None
- hosts: servers
roles:
- { role: jgeusebroek.users, tags: ["users"] }
# The location where the pubkeys can be found.
users_pubkey_location: '{{ playbook_dir }}/files/pubkeys/{{ inventory_hostname }}/'
users_available:
- username: foo
uid: 1001
name: "Foo"
home: "/var/www/foo"
upload_key: true
auth_file: "foocustom.pub" # define specific pubkey file (otherwise it will assume username.pub)
- username: bar
uid: 1002
gid: 1080
name: "Hello World"
upload_key: true
users_deleted:
- username: barfoo
users_groups_available:
- groupname: admin
gid: 1050
- groupname: sysgroup
gid: 801
is_system_group: true
users_groups_deleted:
- deleteme
MIT / BSD
This role was created in 2015 by Jeroen Geusebroek.