From 667bbb2e3b52623554b96183a0b418809e27273c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Bed=C5=99ich?= Date: Tue, 27 Dec 2016 10:31:04 +0100 Subject: [PATCH 1/2] Fixed compatibility with RHEL Introduced conditional name of SSH daemon service based on ansible_os_family --- handlers/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/main.yml b/handlers/main.yml index 8826823..4380a57 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,4 +1,4 @@ --- - name: SFTP-Server | Restart sshd - service: name=ssh + service: name={{ 'ssh' if ansible_os_family == 'Debian' else 'sshd' }} state=restarted From 1a36500060239922ed45f3c901a86d10bf69c42e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Bed=C5=99ich?= Date: Tue, 27 Dec 2016 11:11:05 +0100 Subject: [PATCH 2/2] Set necessary SELinux booleans Needed for SFP to work on RHEL when SELinux is enabled --- tasks/main.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index f596fce..058b576 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -18,6 +18,20 @@ register: sftp_sshd_config_content changed_when: True == False +- name: SFTP-Server | Ensure SELinux management package is present + package: name=libsemanage-python state=present + when: ansible_selinux + +- name: SFTP-Server | Set SELinux booleans + seboolean: + name: "{{ item }}" + state: yes + persistent: yes + with_items: + - ssh_chroot_full_access + - ssh_chroot_rw_homedirs + when: ansible_selinux + # Create/recreate ssh_config. - name: SFTP-Server | Apply sshd_config template template: src=sshd_config.j2