Skip to content

Commit

Permalink
Merge pull request #551 from pkesavap/3.0.0
Browse files Browse the repository at this point in the history
Temporary fix for invalid selinux issue, due to upstream issue in template module in ansible
  • Loading branch information
pkesavap committed Apr 13, 2020
2 parents 9d9d54a + b8cb1dd commit e995491
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions playbooks/ganesha-conf-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
7 changes: 7 additions & 0 deletions playbooks/set-selinux-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -14,3 +20,4 @@
with_items: "{{ mntpath }}"
when: mntpath is defined


0 comments on commit e995491

Please sign in to comment.