summaryrefslogtreecommitdiffstats
path: root/roles/openshift_node/tasks/storage_plugins/nfs.yml
blob: 5f99f129c06ec577f7b692075afce53c82c9dbbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
- name: Install NFS storage plugin dependencies
  action: "{{ ansible_pkg_mgr }} name=nfs-utils state=present"
  when: not openshift.common.is_atomic | bool

- name: Check for existence of seboolean
  command: getsebool {{ item }}
  register: getsebool_status
  when: ansible_selinux and ansible_selinux.status == "enabled"
  failed_when: false
  changed_when: false
  with_items:
    - virt_use_nfs
    - virt_sandbox_use_nfs

- name: Set seboolean to allow nfs storage plugin access from containers
  seboolean:
    name: "{{ item.item }}"
    state: yes
    persistent: yes
  # We need to detect whether or not the boolean is an alias, since `seboolean`
  # will error if it is an alias.  We do this by inspecting stdout for the boolean name,
  # since getsebool prints the resolved name.  (At some point Ansible's seboolean module
  # should learn to deal with aliases)
  when: ansible_selinux and ansible_selinux.status == "enabled" and item.rc == 0 and item.stdout.find(item.item) != -1
  with_items: "{{ getsebool_status.results }}"