The role now works for both debian and RH based distributions.

This commit is contained in:
Andrea Dell'Amico 2019-01-23 13:11:05 +01:00
parent 8e0c1ed830
commit 4fb544e092
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,9 @@
--- ---
- name: Reload the ssh service - name: Reload the ssh service
service: name=ssh state=reloaded service: name=ssh state=reloaded
when: ansible_distribution_file_variety == 'Debian'
- name: Reload the ssh service
service: name=sshd state=reloaded
when: ansible_distribution_file_variety == 'RedHat'

View File

@ -96,7 +96,11 @@ AcceptEnv LANG LC_*
UsePAM {{ sshd_use_pam }} UsePAM {{ sshd_use_pam }}
{% if sshd_enable_sftp_subsystem %} {% if sshd_enable_sftp_subsystem %}
{% if ansible_distribution_file_variety == 'RedHat' %}
Subsystem sftp /usr/libexec/openssh/sftp-server
{% else %}
Subsystem sftp /usr/lib/openssh/sftp-server Subsystem sftp /usr/lib/openssh/sftp-server
{% endif %}
{% if sshd_enable_sftp_jail %} {% if sshd_enable_sftp_jail %}
Match Group {{ sshd_sftp_chroot_match_group }} Match Group {{ sshd_sftp_chroot_match_group }}
ChrootDirectory {{ sshd_sftp_chroot_directory }} ChrootDirectory {{ sshd_sftp_chroot_directory }}