From 73b370cacf95183412f9df331c18f339e587e4ef Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Thu, 9 Apr 2020 14:48:53 +0200 Subject: [PATCH] osd: fix monitor_name error when scaling out OSDs This commit fixes a bug when trying to scale out osd nodes with `crush_rule_config` is enabled. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1822599 Signed-off-by: Guillaume Abrioux (cherry picked from commit 4bcc52cb2aad9bac563025ba4fd9ae4565524b67) --- roles/ceph-facts/tasks/facts.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/ceph-facts/tasks/facts.yml b/roles/ceph-facts/tasks/facts.yml index efbfc0fe8..18c0392d9 100644 --- a/roles/ceph-facts/tasks/facts.yml +++ b/roles/ceph-facts/tasks/facts.yml @@ -26,7 +26,12 @@ - name: set_fact monitor_name ansible_hostname set_fact: - monitor_name: "{{ ansible_hostname }}" + monitor_name: "{{ hostvars[item]['ansible_hostname'] }}" + delegate_to: "{{ item }}" + delegate_facts: true + with_items: "{{ groups.get(mon_group_name, []) }}" + run_once: true + when: groups.get(mon_group_name, []) | length > 0 - name: find a running monitor when: groups.get(mon_group_name, []) | length > 0 -- 2.39.5