From 0bc692d60aa66be512abfb515c6ec087eabdcb22 Mon Sep 17 00:00:00 2001 From: Valentin Gologuzov Date: Thu, 9 Apr 2015 13:38:53 +0200 Subject: [PATCH] [copr] restorecon for pgsql data dir if it has wrong selinux context --- roles/copr/frontend/tasks/main.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/copr/frontend/tasks/main.yml b/roles/copr/frontend/tasks/main.yml index 119624a82b..055e7e3d15 100644 --- a/roles/copr/frontend/tasks/main.yml +++ b/roles/copr/frontend/tasks/main.yml @@ -89,3 +89,11 @@ - name: set dev banner for dev instance when: devel copy: src=banner-include.html dest=/var/lib/copr/ + + +- command: "ls -dZ /var/lib/pgsql" + register: pgsql_ls + +- name: update selinux context for postgress db dir if it's wrong + command: "restorecon -vvRF /var/lib/pgsql" + when: "'postgresql_db_t' not in pgsql_ls.stdout "