summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-08-17 17:02:41 -0400
committerScott Dodson <sdodson@redhat.com>2016-08-24 16:02:49 -0400
commit7999e06a0ea70fb9e7967fd14bf4a96748b3b4da (patch)
tree63205a46179e5519dccc7af2608b7c05b7208705 /roles
parent85c6743a011884abfcdb2ded665e46f46023522e (diff)
downloadopenshift-7999e06a0ea70fb9e7967fd14bf4a96748b3b4da.tar.gz
openshift-7999e06a0ea70fb9e7967fd14bf4a96748b3b4da.tar.bz2
openshift-7999e06a0ea70fb9e7967fd14bf4a96748b3b4da.tar.xz
openshift-7999e06a0ea70fb9e7967fd14bf4a96748b3b4da.zip
Add metrics exports to nfs role, move exports to /etc/exports.d/openshift-ansible.exports
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_storage_nfs/tasks/main.yml17
-rw-r--r--roles/openshift_storage_nfs/templates/exports.j21
2 files changed, 17 insertions, 1 deletions
diff --git a/roles/openshift_storage_nfs/tasks/main.yml b/roles/openshift_storage_nfs/tasks/main.yml
index fe7f83cbb..2928fbb1e 100644
--- a/roles/openshift_storage_nfs/tasks/main.yml
+++ b/roles/openshift_storage_nfs/tasks/main.yml
@@ -30,11 +30,26 @@
- name: Configure exports
template:
- dest: /etc/exports
+ dest: /etc/exports.d/openshift-ansible.exports
src: exports.j2
notify:
- restart nfs-server
+# Now that we're putting our exports in our own file clean up the old ones
+- name: register exports
+ command: cat /etc/exports.d/openshift-ansible.exports
+ register: exports_out
+
+- name: remove exports from /etc/exports
+ lineinfile:
+ dest: /etc/exports
+ line: "{{ item }}"
+ state: absent
+ with_items: "{{ exports_out.stdout_lines | default([]) }}"
+ when: exports_out.rc == 0
+ notify:
+ - restart nfs-server
+
- name: Enable and start services
service:
name: "{{ item }}"
diff --git a/roles/openshift_storage_nfs/templates/exports.j2 b/roles/openshift_storage_nfs/templates/exports.j2
index c1e1994b0..d6d936b72 100644
--- a/roles/openshift_storage_nfs/templates/exports.j2
+++ b/roles/openshift_storage_nfs/templates/exports.j2
@@ -1 +1,2 @@
{{ openshift.hosted.registry.storage.nfs.directory }}/{{ openshift.hosted.registry.storage.volume.name }} {{ openshift.hosted.registry.storage.nfs.options }}
+{{ openshift.hosted.metrics.storage.nfs.directory }}/{{ openshift.hosted.metrics.storage.volume.name }} {{ openshift.hosted.metrics.storage.nfs.options }}