Skip to content

Commit

Permalink
Merge pull request #44 from smag-bmesseca/master
Browse files Browse the repository at this point in the history
Fix sftp_start_directory
  • Loading branch information
johanmeiring authored Jul 1, 2020
2 parents 3278676 + 60edecd commit 47d0580
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down

0 comments on commit 47d0580

Please sign in to comment.