File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ The following attributes are required for each user:
27
27
* username - The user's username.
28
28
* name - The full name of the user (gecos field)
29
29
* home - the home directory of the user to create (optional, defaults to /home/username)
30
- * uid - The numeric user id for the user. This is required for uid consistency
30
+ * uid - The numeric user id for the user (optional) . This is required for uid consistency
31
31
across systems.
32
32
* gid - The numeric group id for the group (optional). Otherwise, the
33
33
uid will be used
@@ -39,7 +39,7 @@ The following attributes are required for each user:
39
39
* group - optional primary group override
40
40
* groups - a list of supplementary groups for the user.
41
41
* profile - a string block for setting custom shell profiles
42
- * ssh_key - This should be a list of ssh keys for the user. Each ssh key
42
+ * ssh_key - This should be a list of ssh keys for the user (optional) . Each ssh key
43
43
should be included directly and should have no newlines.
44
44
* generate_ssh_key - Whether to generate a SSH key for the user (optional, defaults to no).
45
45
Original file line number Diff line number Diff line change 6
6
7
7
- name : Per-user group creation
8
8
group : name="{{item.username}}"
9
- gid="{{item.gid if item.gid is defined else item.uid }}"
9
+ gid="{{item.gid | default( item.uid) | default(omit) }}"
10
10
with_items : " {{users}}"
11
11
when : " 'group' not in item and users_create_per_user_group"
12
12
tags : ['users','configuration']
20
20
shell : " {{item.shell if item.shell is defined else users_default_shell}}"
21
21
password : " {{item.password if item.password is defined else '!'}}"
22
22
comment : " {{item.name if item.name is defined else ''}}"
23
- uid : " {{item.uid}}"
23
+ uid : " {{item.uid | default(omit) }}"
24
24
home : " {{ item.home | default('/home/' + item.username) }}"
25
25
createhome : " {{'yes' if users_create_homedirs else 'no'}}"
26
26
generate_ssh_key : " {{ item.generate_ssh_key | default(omit) }}"
36
36
with_subelements :
37
37
- " {{users}}"
38
38
- ssh_key
39
+ - skip_missing : yes
39
40
tags : ['users','configuration']
40
41
41
42
- name : Setup user profiles
You can’t perform that action at this time.
0 commit comments