Skip to content

Commit f2eb049

Browse files
author
choglundsp
authored
Merge pull request #3 from singleplatform-eng/make_groups_optional
make secondary user groups optional
2 parents bc601a4 + 0f32121 commit f2eb049

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tasks/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
user:
1515
name: "{{item.username}}"
1616
group: "{{item.username if users_create_per_user_group else users_group}}"
17-
groups: "{{item.groups | join(',')}}"
17+
# empty string removes user from all secondary groups
18+
groups: "{{item.groups | join(',') if 'groups' in item else ''}}"
1819
shell: "{{item.shell if item.shell is defined else users_default_shell}}"
1920
password: "{{item.password if item.password is defined else '!'}}"
2021
comment: "{{item.name}}"

0 commit comments

Comments
 (0)