From 98f223c4d054218bda597525c70b257965ce2197 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Tue, 24 Mar 2020 17:11:44 -0400 Subject: [PATCH] ceph-facts: fix rgw_instances_all fact 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 (cherry picked from commit 0487d21938c91d4f3a48cb7157aa9b9a00f21f8f) --- roles/ceph-facts/tasks/set_radosgw_address.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/roles/ceph-facts/tasks/set_radosgw_address.yml b/roles/ceph-facts/tasks/set_radosgw_address.yml index 2da3acaeb..867b4686a 100644 --- a/roles/ceph-facts/tasks/set_radosgw_address.yml +++ b/roles/ceph-facts/tasks/set_radosgw_address.yml @@ -59,12 +59,18 @@ - 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 -- 2.39.5