From bd12158a1c1debd58313ddece81867d399ceabb3 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 13 Jul 2020 09:42:25 +0200 Subject: [PATCH] facts: fix broken facts when using --limit This commit fixes these tasks when --limit is used. It makes sure the fact is set on right nodes even when the playbook is run with `--limit` Signed-off-by: Guillaume Abrioux (cherry picked from commit f8a951f50c6a64ab3d60a1bf66ca9d2db2f6bc35) --- roles/ceph-facts/tasks/facts.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/roles/ceph-facts/tasks/facts.yml b/roles/ceph-facts/tasks/facts.yml index 399365828..23ff27fed 100644 --- a/roles/ceph-facts/tasks/facts.yml +++ b/roles/ceph-facts/tasks/facts.yml @@ -290,14 +290,16 @@ run_once: True with_items: - "{{ groups[mon_group_name] if groups[mon_group_name] | default([]) | length > 0 else [] }}" - - "{{ inventory_hostname }}" + - "{{ groups[mds_group_name] if groups[mds_group_name] | default([]) | length > 0 else [] }}" + - "{{ groups[client_group_name] if groups[client_group_name] | default([]) | length > 0 else [] }}" - name: set_fact ceph_admin_command set_fact: - ceph_admin_command: "{{ ceph_run_cmd }} -n client.admin -k /etc/ceph/{{ cluster }}.client.admin.keyring" + ceph_admin_command: "{{ hostvars[item]['ceph_run_cmd'] }} -n client.admin -k /etc/ceph/{{ cluster }}.client.admin.keyring" delegate_to: "{{ item }}" delegate_facts: True run_once: True with_items: - "{{ groups[mon_group_name] if groups[mon_group_name] | default([]) | length > 0 else [] }}" - - "{{ inventory_hostname }}" \ No newline at end of file + - "{{ groups[mds_group_name] if groups[mds_group_name] | default([]) | length > 0 else [] }}" + - "{{ groups[client_group_name] if groups[client_group_name] | default([]) | length > 0 else [] }}" \ No newline at end of file