Add new user
To add a user or admin to the hosts, go through these steps:
Username¶
First things first, define a username for the new user and add that to either the admins
or the jailusers
list, depending on what the user should be used for. The username should be alphanumeric, all lower-case and idealy consisting of first and last name of the real user.
The lists are defined in [INVENTORY]/group_vars/all/system.yml
.
SSH Public Key¶
Get the public key of the user and store it in [INVENTORY]/files/keys/[USERNAME].d2s.pub
.
User Variables¶
Create a file [INVENTORY]/user_vars/[USERNAME].yml
and define all required user variables. Note: because a yaml file can never be empty, you have to define at least one variable, even if that is a dummy, otherwise you will be seeing syntax errors when running play.
Supported variables:
env
: a dictionary with key/value pairs which will be set as environment variables for that user on the remote host.
groups
: a comma separated list of group names ti which that user will be added on the remote host.
Running Play¶
1 |
|
Quick Running Play¶
This one is much faster than the previous one and can always been used to simply update permissions.
1 |
|
In addition this will also reset the users which will remove permissions if required where the previous one only appends to the already existing settings.
1 |
|
If you're using jails, then you should once call the following to initialize all users in each jail.
1 |
|