From d1441d3d9922a34dd963ac676a8e3ee6af220b25 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Sun, 22 Feb 2015 14:08:37 +0000 Subject: [PATCH] Replace this with a hopefully much faster version. --- playbooks/include/proxies-websites.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/playbooks/include/proxies-websites.yml b/playbooks/include/proxies-websites.yml index bcdd159304..e6f96a2fe8 100644 --- a/playbooks/include/proxies-websites.yml +++ b/playbooks/include/proxies-websites.yml @@ -64,11 +64,24 @@ tags: - httpd - httpd/website - - name: ..and apply the httpd_sys_content_t type recursively to it. - file: > - dest=/srv/web state=directory - setype=httpd_sys_content_t recurse=True + + - name: check the selinux context of webdir + command: matchpathcon /srv/web + register: webdir + always_run: yes + changed_when: "1 != 1" tags: + - config + - selinux + - httpd + - httpd/website + + - name: /srv/web file contexts + command: semanage fcontext -a -t httpd_sys_content_t "/srv/web(/.*)?" + when: webdir.stdout.find('httpd_sys_content_t') == -1 + tags: + - config + - selinux - httpd - httpd/website