Skip to content
Snippets Groups Projects
Commit 5b86b943 authored by Zuul's avatar Zuul Committed by Gerrit Code Review
Browse files

Merge "Avoid unconditional fact gathering"

parents 47e2baf9 e0ba55a8
No related branches found
No related tags found
No related merge requests found
---
# NOTE(awiddersheim): Gather facts for all hosts as a
# first step since several plays below require them when
# building their configurations. The below 'gather_facts'
# set to 'false' is a bit confusing but this is to avoid
# Ansible gathering facts twice.
# building their configurations.
- name: Gather facts for all hosts
hosts: all
serial: '{{ kolla_serial|default("0") }}'
gather_facts: false
gather_facts: true
tasks:
- name: Gather facts
setup:
- name: Group hosts to determine when using --limit
group_by:
key: "all_using_limit_{{ (ansible_play_batch | length) != (groups['all'] | length) }}"
......@@ -40,5 +35,6 @@
delegate_to: "{{ item }}"
with_items: "{{ delegate_hosts }}"
# We gathered facts for all hosts in the batch during the first play.
when: item not in ansible_play_batch
when:
- not hostvars[item].module_setup | default(false)
tags: always
---
upgrade:
- |
Avoids unnecessary fact gathering using the ``setup`` module. This should
improve the performance of environments using fact caching and the Ansible
``smart`` fact gathering policy. See `blueprint
<https://blueprints.launchpad.net/kolla-ansible/+spec/performance-improvements>`__
for details.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment