Browse Source

GlusterFS: Use groups variables

Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Jose A. Rivera 8 years ago
parent
commit
73d0a3857a

+ 1 - 1
roles/openshift_storage_glusterfs/tasks/glusterfs_config.yml

@@ -17,6 +17,6 @@
     glusterfs_heketi_topology_load: "{{ openshift_storage_glusterfs_heketi_topology_load }}"
     glusterfs_heketi_wipe: "{{ openshift_storage_glusterfs_heketi_wipe }}"
     glusterfs_heketi_url: "{{ openshift_storage_glusterfs_heketi_url }}"
-    glusterfs_nodes: "{{ g_glusterfs_hosts }}"
+    glusterfs_nodes: "{{ groups.glusterfs }}"
 
 - include: glusterfs_common.yml

+ 4 - 2
roles/openshift_storage_glusterfs/tasks/glusterfs_registry.yml

@@ -17,10 +17,12 @@
     glusterfs_heketi_topology_load: "{{ openshift_storage_glusterfs_registry_heketi_topology_load }}"
     glusterfs_heketi_wipe: "{{ openshift_storage_glusterfs_registry_heketi_wipe }}"
     glusterfs_heketi_url: "{{ openshift_storage_glusterfs_registry_heketi_url }}"
-    glusterfs_nodes: "{{ g_glusterfs_registry_hosts }}"
+    glusterfs_nodes: "{{ groups.glusterfs_registry }}"
 
 - include: glusterfs_common.yml
-  when: g_glusterfs_registry_hosts != g_glusterfs_hosts
+  when:
+  - "'glusterfs_registry' in groups"
+  - "'glusterfs' not in groups or groups.glusterfs_registry != groups.glusterfs"
 
 - name: Delete pre-existing GlusterFS registry resources
   oc_obj:

+ 2 - 2
roles/openshift_storage_glusterfs/tasks/main.yml

@@ -7,11 +7,11 @@
 
 - include: glusterfs_config.yml
   when:
-  - g_glusterfs_hosts | default([]) | count > 0
+  - groups.glusterfs | default([]) | count > 0
 
 - include: glusterfs_registry.yml
   when:
-  - g_glusterfs_registry_hosts | default([]) | count > 0
+  - groups.glusterfs_registry | default([]) | count > 0
   - "openshift.hosted.registry.storage.kind == 'glusterfs' or openshift.hosted.registry.glusterfs.swap"
 
 - name: Delete temp directory