File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ The following attributes are required for each user:
33
33
uid will be used
34
34
* password - If a hash is provided then that will be used, but otherwise the
35
35
account will be locked
36
+ * group - optional primary group override
36
37
* groups - a list of supplementary groups for the user.
37
38
* profile - a string block for setting custom shell profiles
38
39
* ssh-key - This should be a list of ssh keys for the user. Each ssh key
Original file line number Diff line number Diff line change 8
8
group : name="{{item.username}}"
9
9
gid="{{item.gid if item.gid is defined else item.uid}}"
10
10
with_items : " {{users}}"
11
- when : users_create_per_user_group
11
+ when : ' group ' not in item and users_create_per_user_group
12
12
tags : ['users','configuration']
13
13
14
14
- name : User creation
15
15
user :
16
16
name : " {{item.username}}"
17
- group : " {{item.username if users_create_per_user_group else users_group}}"
17
+ group : " {{item.group | default(item. username if users_create_per_user_group else users_group) }}"
18
18
# empty string removes user from all secondary groups
19
19
groups : " {{item.groups | join(',') if 'groups' in item else ''}}"
20
20
shell : " {{item.shell if item.shell is defined else users_default_shell}}"
41
41
block : " {{item.profile}}"
42
42
dest : " {{ item.home | default('/home/' + item.username) }}/.profile"
43
43
owner : " {{item.username}}"
44
- group : " {{item.username if users_create_per_user_group else users_group}}"
44
+ group : " {{item.group | default(item. username if users_create_per_user_group else users_group) }}"
45
45
mode : 0644
46
46
create : true
47
47
when : users_create_homedirs and item.profile is defined
You can’t perform that action at this time.
0 commit comments