From ce976181d94be39c5510252c1faef4e796bc48c3 Mon Sep 17 00:00:00 2001 From: Andrew Butcher Date: Sun, 17 Jul 2016 18:11:59 -0400 Subject: Check for existence of sebooleans prior to setting. --- roles/openshift_node/tasks/storage_plugins/nfs.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'roles/openshift_node/tasks/storage_plugins/nfs.yml') diff --git a/roles/openshift_node/tasks/storage_plugins/nfs.yml b/roles/openshift_node/tasks/storage_plugins/nfs.yml index 8380714d4..e384c1bd7 100644 --- a/roles/openshift_node/tasks/storage_plugins/nfs.yml +++ b/roles/openshift_node/tasks/storage_plugins/nfs.yml @@ -3,16 +3,30 @@ action: "{{ ansible_pkg_mgr }} name=nfs-utils state=present" when: not openshift.common.is_atomic | bool +- name: Check for existence of virt_use_nfs seboolean + command: getsebool virt_use_nfs + register: virt_use_nfs_output + when: ansible_selinux and ansible_selinux.status == "enabled" + failed_when: false + changed_when: false + - name: Set seboolean to allow nfs storage plugin access from containers seboolean: name: virt_use_nfs state: yes persistent: yes + when: ansible_selinux and ansible_selinux.status == "enabled" and virt_use_nfs_output.rc == 0 + +- name: Check for existence of virt_sandbox_use_nfs seboolean + command: getsebool virt_sandbox_use_nfs + register: virt_sandbox_use_nfs_output when: ansible_selinux and ansible_selinux.status == "enabled" + failed_when: false + changed_when: false - name: Set seboolean to allow nfs storage plugin access from containers(sandbox) seboolean: name: virt_sandbox_use_nfs state: yes persistent: yes - when: ansible_selinux and ansible_selinux.status == "enabled" + when: ansible_selinux and ansible_selinux.status == "enabled" and virt_sandbox_use_nfs_output.rc == 0 -- cgit v1.2.3