]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
do not delegate facts on client nodes
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 21 Mar 2018 18:01:51 +0000 (19:01 +0100)
committerSébastien Han <seb@redhat.com>
Wed, 4 Apr 2018 07:23:03 +0000 (09:23 +0200)
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>
site-docker.yml.sample

index 58098ad3c217bbd4fc265f9bd27f93a161d7573d..6f64ceb72a5f2ef8ad5f42a8fd736624306e69b7 100644 (file)
     - 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