1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- ---
- - name: Install nfs-utils
- yum:
- pkg: nfs-utils
- state: present
- - name: Configure NFS
- lineinfile:
- dest: /etc/sysconfig/nfs
- regexp: "{{ item.regex }}"
- line: "{{ item.line }}"
- register: nfs_config
- with_items:
- - regex: '^RPCNFSDARGS=.*$'
- line: 'RPCNFSDARGS="-N 2 -N 3"'
- - regex: '^RPCMOUNTDOPTS=.*$'
- line: 'RPCMOUNTDOPTS="-p 20048"'
- - regex: '^STATDARG=.*$'
- line: 'STATDARG="-p 50825"'
- - name: Restart nfs-config
- service: name=nfs-config state=restarted
- when: "True in (nfs_config.results | oo_collect(attribute='changed') | list)"
- - name: Ensure exports directory exists
- file:
- path: "{{ openshift.hosted.registry.storage.nfs.directory }}"
- state: directory
- - name: Ensure export directories exist
- file:
- path: "{{ openshift.hosted.registry.storage.nfs.directory }}/{{ item }}"
- state: directory
- mode: 0777
- owner: nfsnobody
- group: nfsnobody
- with_items:
- - "{{ openshift.hosted.registry.storage.volume.name }}"
- - 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
- | oo_collect(attribute='changed')
- | list) }}"
|