Skip to content

Commit

Permalink
Support the append argument to the user module
Browse files Browse the repository at this point in the history
When true, this argument prevents removal of an existing user from groups
not listed in the groups argument.
  • Loading branch information
markgoddard committed Sep 9, 2017
1 parent f0ee28b commit c2446e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ The following attributes are required for each user:
- 'on_create' will only set the password for newly created users.
* group - optional primary group override
* groups - a list of supplementary groups for the user.
* append - if yes, will only add groups, not set them to just the list in groups (optional).
* profile - a string block for setting custom shell profiles
* ssh_key - This should be a list of ssh keys for the user (optional). Each ssh key
should be included directly and should have no newlines.
Expand Down
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
group: "{{item.group | default(item.username if users_create_per_user_group else users_group)}}"
# empty string removes user from all secondary groups
groups: "{{item.groups | join(',') if 'groups' in item else ''}}"
append: "{{item.append | default(omit)}}"
shell: "{{item.shell if item.shell is defined else users_default_shell}}"
password: "{{item.password if item.password is defined else '!'}}"
comment: "{{item.name if item.name is defined else ''}}"
Expand Down

0 comments on commit c2446e8

Please sign in to comment.