Skip to content

Commit

Permalink
Merge pull request #20 from jpiron/append_user_groups
Browse files Browse the repository at this point in the history
Add append sftp_users configuration option
  • Loading branch information
Johan Meiring authored Aug 6, 2017
2 parents fc880b3 + 9d57419 commit 8bd2d24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The following role variables are relevant:
* `shell`: Boolean indicating if the user should have a shell access (default to `True`).
* `authorized`: An optional list of files placed in `files/` which contain valid public keys for the SFTP user.
* `sftp_directories`: A list of directories that need to be individually created for an SFTP user. Defaults to a blank list (i.e. "[]").
* `append`: Boolean to add `sftp_group_name` to the user groups (if any) instead of setting it (defaut to `False`).


## Example Playbook
Expand All @@ -55,6 +56,7 @@ The following role variables are relevant:
- name: sally
password: ""
authorized: [sally.pub]
append: True
- sftp_directories:
- imports
- exports
Expand Down
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
user:
name: "{{ item.name }}"
groups: "{{ sftp_group_name }}"
append: "{{ item.append | default(False) }}"
home: "{{ sftp_home_partition }}/{{ item.name }}"
# `None` means default value -> default is to have a shell
shell: "{{ None if (item.shell | default(True)) else '/sbin/nologin' }}"
Expand Down

0 comments on commit 8bd2d24

Please sign in to comment.