aboutsummaryrefslogtreecommitdiff
path: root/ansible/gather-facts.yml
diff options
context:
space:
mode:
authorMark Goddard <mark@stackhpc.com>2023-10-30 14:36:48 +0000
committerMark Goddard <mark@stackhpc.com>2023-11-15 17:07:08 +0000
commit7f01f47bdad93383a4e2b884c4216d7db925d67f (patch)
treedfd3ca91d5570026b751470cb172f1b9a0c54217 /ansible/gather-facts.yml
parent8709db2a257849a34c745b68282ebc5907d39e00 (diff)
downloadkolla-ansible-7f01f47bdad93383a4e2b884c4216d7db925d67f.tar.gz
kolla-ansible-7f01f47bdad93383a4e2b884c4216d7db925d67f.zip
fact gathering: Group hosts before gathering facts
If not using --limit, each host runs the setup module for itself only. Hosts should be able to fail at this point and drop out of execution without affecting others. However, there is a bug that causes us to hit the --limit code path for an unreachable host and therefore become subject to its limitations. These include the use of delegated fact gathering, and failing the delegated host when the delegating host is unreachable. This change fixes the issue by reversing the order of two tasks in the gather-facts.yml playbook, ensuring that we check the ansible_play_batch variable before any hosts have had a chance to fail. Change-Id: I4b1da63e8f0cc2774f1a9ab2e0414746108f7e12 Closes-Bug: #2041859
Diffstat (limited to 'ansible/gather-facts.yml')
-rw-r--r--ansible/gather-facts.yml10
1 files changed, 5 insertions, 5 deletions
diff --git a/ansible/gather-facts.yml b/ansible/gather-facts.yml
index f5247a6ab..a375197c9 100644
--- a/ansible/gather-facts.yml
+++ b/ansible/gather-facts.yml
@@ -8,17 +8,17 @@
serial: '{{ kolla_serial|default("0") }}'
gather_facts: false
tasks:
+ - name: Group hosts to determine when using --limit
+ group_by:
+ key: "all_using_limit_{{ (ansible_play_batch | length) != (groups['all'] | length) }}"
+ changed_when: false
+
- name: Gather facts
setup:
filter: "{{ kolla_ansible_setup_filter }}"
gather_subset: "{{ kolla_ansible_setup_gather_subset }}"
when:
- not ansible_facts
-
- - name: Group hosts to determine when using --limit
- group_by:
- key: "all_using_limit_{{ (ansible_play_batch | length) != (groups['all'] | length) }}"
- changed_when: false
tags: always
# NOTE(pbourke): This case covers deploying subsets of hosts using --limit. The