do not delegate facts on client nodes

This commit is a workaround for
https://bugzilla.redhat.com/show_bug.cgi?id=1550977

We iterate over all nodes on each node and we delegate the facts gathering.
This is high memory consuming when having a large number of nodes in the
inventory.
That way of gathering is not necessary for clients node so we can simply
gather local facts for these nodes.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/2494/head
Guillaume Abrioux 2018-03-21 19:01:51 +01:00 committed by Sébastien Han
parent e32a177af8
commit 5b73be254d
1 changed files with 2 additions and 2 deletions

View File

@ -24,13 +24,13 @@
- name: gather facts
setup:
when:
- not delegate_facts_host | bool
- not delegate_facts_host | bool or inventory_hostname in groups.get('clients', [])
- name: gather and delegate facts
setup:
delegate_to: "{{ item }}"
delegate_facts: True
with_items: "{{ groups['all'] }}"
with_items: "{{ groups['all'] | difference(groups.get('clients', [])) }}"
when:
- delegate_facts_host | bool