Add new user
To add a user or admin to the hosts, go through these steps:
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
SSH Public Key¶
Get the public key of the user and store it in
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.
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.
Quick Running Play¶
This one is much faster than the previous one and can always been used to simply update permissions.
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.
If you're using jails, then you should once call the following to initialize all users in each jail.