12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- ---
- - name: Set nfs facts
- openshift_facts:
- role: nfs
- local_facts:
- exports_dir: "{{ openshift_nfs_exports_dir | default(None) }}"
- export_options: "{{ openshift_nfs_export_options | default(None) }}"
- registry_volume: "{{ openshift_nfs_registry_volume | default(None) }}"
- - name: Install nfs-utils
- yum:
- pkg: nfs-utils
- state: present
- - name: Ensure exports directory exists
- file:
- path: "{{ openshift.nfs.exports_dir }}"
- state: directory
- - name: Ensure export directories exist
- file:
- path: "{{ openshift.nfs.exports_dir }}/{{ item }}"
- state: directory
- mode: 0777
- owner: nfsnobody
- group: nfsnobody
- with_items:
- - "{{ openshift.nfs.registry_volume }}"
- - name: Configure exports
- template:
- dest: /etc/exports
- src: exports.j2
- notify:
- - restart nfs-server
- - name: Enable and start services
- service:
- name: "{{ item }}"
- state: started
- enabled: yes
- register: start_result
- with_items:
- - nfs-server
- - set_fact:
- nfs_service_status_changed: "{{ True in (start_result.results
- | map(attribute='changed')
- | list) }}"
|