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>
- 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