From 4fb544e0929234f955ac1f403df6317a86eca50b Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 23 Jan 2019 13:11:05 +0100 Subject: [PATCH] The role now works for both debian and RH based distributions. --- sshd_config/handlers/main.yml | 6 ++++++ sshd_config/templates/sshd_config.j2 | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/sshd_config/handlers/main.yml b/sshd_config/handlers/main.yml index 67979564..3b64a782 100644 --- a/sshd_config/handlers/main.yml +++ b/sshd_config/handlers/main.yml @@ -1,3 +1,9 @@ --- - name: Reload the ssh service 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' + diff --git a/sshd_config/templates/sshd_config.j2 b/sshd_config/templates/sshd_config.j2 index dd656685..098b02ee 100644 --- a/sshd_config/templates/sshd_config.j2 +++ b/sshd_config/templates/sshd_config.j2 @@ -96,7 +96,11 @@ AcceptEnv LANG LC_* UsePAM {{ sshd_use_pam }} {% 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 +{% endif %} {% if sshd_enable_sftp_jail %} Match Group {{ sshd_sftp_chroot_match_group }} ChrootDirectory {{ sshd_sftp_chroot_directory }}