Skip to content

Commit 0f32121

Browse files
author
Colin Hoglund
committed
make secondary user groups optional
1 parent bc601a4 commit 0f32121

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)