diff options
author | Andrew Butcher <abutcher@redhat.com> | 2016-01-19 14:50:55 -0500 |
---|---|---|
committer | Andrew Butcher <abutcher@redhat.com> | 2016-02-01 17:05:55 -0500 |
commit | 44e5ddc20e7069e5345f48426a69e725aa8ea1d4 (patch) | |
tree | 638eb0ffb58c3482e2fd44766e867d6e68fac0f4 /roles/openshift_storage_nfs/tasks/main.yml | |
parent | 3d3053062ee3bca175df6eb4dd66ff56237234ca (diff) | |
download | openshift-44e5ddc20e7069e5345f48426a69e725aa8ea1d4.tar.gz openshift-44e5ddc20e7069e5345f48426a69e725aa8ea1d4.tar.bz2 openshift-44e5ddc20e7069e5345f48426a69e725aa8ea1d4.tar.xz openshift-44e5ddc20e7069e5345f48426a69e725aa8ea1d4.zip |
Refactor registry storage options.
Diffstat (limited to 'roles/openshift_storage_nfs/tasks/main.yml')
-rw-r--r-- | roles/openshift_storage_nfs/tasks/main.yml | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/roles/openshift_storage_nfs/tasks/main.yml b/roles/openshift_storage_nfs/tasks/main.yml index 64b121ade..770294eba 100644 --- a/roles/openshift_storage_nfs/tasks/main.yml +++ b/roles/openshift_storage_nfs/tasks/main.yml @@ -1,31 +1,41 @@ --- -- 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: 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.nfs.exports_dir }}" + path: "{{ openshift.hosted.registry.storage.nfs.directory }}" state: directory - name: Ensure export directories exist file: - path: "{{ openshift.nfs.exports_dir }}/{{ item }}" + path: "{{ openshift.hosted.registry.storage.nfs.directory }}/{{ item }}" state: directory mode: 0777 owner: nfsnobody group: nfsnobody with_items: - - "{{ openshift.nfs.registry_volume }}" + - "{{ openshift.hosted.registry.storage.volume.name }}" - name: Configure exports template: @@ -45,5 +55,5 @@ - set_fact: nfs_service_status_changed: "{{ True in (start_result.results - | map(attribute='changed') + | oo_collect(attribute='changed') | list) }}" |