From 23a462b6c102e872d81d0b0f6d16d67568b6a626 Mon Sep 17 00:00:00 2001 From: Andy Shinn <315485+andyshinn@users.noreply.github.com> Date: Tue, 3 Apr 2018 13:05:37 -0500 Subject: [PATCH] allow setting of home directory mode --- README.md | 1 + tasks/main.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ab5a50..2ba218c 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ The following role variables are relevant: * `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 (default to `False`). + * `mode`: The users home directory mode (defaults to `0750`). * `sftp_nologin_shell`: The "nologin" user shell. (defaults to /sbin/nologin.) Notes: diff --git a/tasks/main.yml b/tasks/main.yml index 64154be..0937589 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -68,7 +68,7 @@ path: "{{ sftp_home_partition }}/{{ item.name }}" owner: root group: "{{ item.group | default(sftp_group_name) }}" - mode: "0750" + mode: "{{ item.mode | default(0750) }}" with_items: "{{ sftp_users }}" # Install all relevant public keys.