diff --git a/tasks/main.yml b/tasks/main.yml index d77bb5e..da49af1 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -48,7 +48,7 @@ AllowTCPForwarding no PermitTunnel no X11Forwarding no - ForceCommand internal-sftp {{ sftp_enable_logging | ternary('-l VERBOSE', '') }} {{ (sftp_start_directory in sftp_directories) | ternary('-d /' + sftp_start_directory, '') }} + ForceCommand internal-sftp {{ sftp_enable_logging | ternary('-l VERBOSE', '') }} {{ (sftp_start_directory in sftp_directories or sftp_start_directory in sftp_directories | selectattr("name", "defined") | map(attribute='name') | list) | ternary('-d /' + sftp_start_directory, '') }} PasswordAuthentication {{ sftp_allow_passwords | ternary('yes', 'no') }} notify: SFTP-Server | Restart sshd diff --git a/tests/test.yml b/tests/test.yml index 3f774f4..0de6204 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -5,7 +5,9 @@ sftp_directories: - test1 - test2 - sftp_start_directory: test1 + - name: test5 + mode: 770 + sftp_start_directory: test5 sftp_users: - name: user1 password: ""