Hello,
I would like to have a central global list of users with all relevant data, like this:
users:
- username: alice
groups: adm, media, web
sudo: yes
shell: /bin/bash - username: bob
groups: web
sudo: no
shell: /bin/false - username: eva
groups: media, web
sudo: no
shell: /bin/bash
…
in group_vars/all.yml
(is it a good place for it?).
Now, I would like to be able to specify different subsets of that user list for different hosts and, if necessary, to override default data. Furthermore I want to only mention usernames, the rest of data should be taken from the global list, something like this:
host: db1
users:
- alice
- bob
host: web2
users:
- alice
- bob
- eva
groups: media, web, adm
host: media1
users:
- alice
groups: web - eva
sudo: yes
What is the best way to organize it? Which files in which hierarchy? How should the task for user creation look like?
PS: is it wise to have users deleted if they disappear from global/host user lists? If yes - how do I implement this as well?..
Thank you!