]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-facts: fix rgw_instances_all fact
authorDimitri Savineau <dsavinea@redhat.com>
Tue, 24 Mar 2020 21:11:44 +0000 (17:11 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 25 Mar 2020 07:02:13 +0000 (08:02 +0100)
The rgw_instances_all fact is supposed to be the list of all radosgw
instances from all rgw nodes.
But the fact is always using the local rgw_instances variable so this
won't work on multiple nodes.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
roles/ceph-facts/tasks/set_radosgw_address.yml

index 2da3acaebd29db7d85512b0e2526d199225cc629..867b4686aa1ebb3a81defb3487c4b3dfa357a038 100644 (file)
     - rgw_instances is undefined
     - rgw_multisite | bool
 
+- name: set_fact rgw_instances_host
+  set_fact:
+    rgw_instances_host: '{{ rgw_instances_host | default([]) | union([item | combine({"host": inventory_hostname})]) }}'
+  with_items: '{{ rgw_instances }}'
+  when:
+    - inventory_hostname in groups.get(rgw_group_name, [])
+    - rgw_multisite | bool
+
 - name: set_fact rgw_instances_all
   set_fact:
-    rgw_instances_all: '{{ rgw_instances_all | default([]) | union([item.1 | combine({"host": item.0})]) }}'
-  with_nested:
-    - "{{ groups.get(rgw_group_name, []) }}"
-    - "{{ rgw_instances }}"
+    rgw_instances_all: '{{ rgw_instances_all | default([]) | union(hostvars[item]["rgw_instances_host"]) }}'
+  with_items: "{{ groups.get(rgw_group_name, []) }}"
   when:
     - inventory_hostname in groups.get(rgw_group_name, [])
     - rgw_multisite | bool