Ansible Role: users
All user accounts (except the default ubuntu account) are managed through a custom users Ansible role.
Users are defined in a dictionary called users, where the dictionary key corresponds to the user name,
and the value contains settings for that user.
The following properties can be set for each user:
Property |
Description |
|---|---|
|
Setting this to |
|
Groups to add the user to. Groups that do not exist yet are created automatically. |
|
Used to add a single SSH key to the user’s |
|
Used to add multiple SSH keys to the user’s |
So, to add a user named foo, define the following:
users:
foo:
ssh_key: ssh-rsa abcdef...
Or, a more complex example:
users:
foo:
admin: true
groups: custom,groups,to,assign
ssh_keys:
- "{{ lookup('file', 'path/to/first/key.pub') }}"
- "{{ lookup('file', 'path/to/second/key.pub') }}"
- ssh-rsa inline-key