Split out selinux setup in subversion test.

This avoids failures when the sefcontext module is not present.
This commit is contained in:
Matt Clay 2020-02-12 10:15:31 -08:00
parent 8d574c3770
commit a928db1420
2 changed files with 13 additions and 12 deletions

View file

@ -24,18 +24,8 @@
path: '{{ subversion_server_dir }}'
state: directory
- name: set SELinux security context for SVN folder
sefcontext:
target: '{{ subversion_server_dir }}(/.*)?'
setype: '{{ item }}'
state: present
when: ansible_selinux.status == "enabled"
with_items:
- httpd_sys_content_t
- httpd_sys_rw_content_t
- name: apply new SELinux context to filesystem
command: restorecon -irv {{ subversion_server_dir | quote }}
- name: setup selinux when enabled
include_tasks: setup_selinux.yml
when: ansible_selinux.status == "enabled"
- name: template out configuration file

View file

@ -0,0 +1,11 @@
- name: set SELinux security context for SVN folder
sefcontext:
target: '{{ subversion_server_dir }}(/.*)?'
setype: '{{ item }}'
state: present
with_items:
- httpd_sys_content_t
- httpd_sys_rw_content_t
- name: apply new SELinux context to filesystem
command: restorecon -irv {{ subversion_server_dir | quote }}