diff --git a/playbooks/ganesha-conf-create.yml b/playbooks/ganesha-conf-create.yml index 7a800d6..5080593 100644 --- a/playbooks/ganesha-conf-create.yml +++ b/playbooks/ganesha-conf-create.yml @@ -10,6 +10,9 @@ - name: Copy ganesha.conf to config directory on shared volume shell: cp -rf /etc/ganesha/* "{{ ha_base_dir }}" + - name: ensure file already exists at template dest to work around 'invalid selinux context' issue + file: path="{{ ha_base_dir }}/ganesha-ha.conf" state=touch + - name: Creating ganesha-ha.conf file template: src=ganesha-ha.conf dest="{{ ha_base_dir }}" diff --git a/playbooks/set-selinux-labels.yml b/playbooks/set-selinux-labels.yml index c2cbc4f..6c116c3 100644 --- a/playbooks/set-selinux-labels.yml +++ b/playbooks/set-selinux-labels.yml @@ -4,6 +4,12 @@ gather_facts: no tasks: + - name: Deleting existing SELinux label if any + shell: semanage fcontext -d {{ item.path }} + with_items: "{{ mntpath }}" + when: mntpath is defined + ignore_errors: yes + - name: Set SELinux labels on the bricks shell: semanage fcontext -a -t glusterd_brick_t {{ item.path }} with_items: "{{ mntpath }}" @@ -14,3 +20,4 @@ with_items: "{{ mntpath }}" when: mntpath is defined +