]> 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 09:34:11 +0000 (11:34 +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>
(cherry picked from commit 5b73be254d249a23ac2eb2f86c4412ef296352a9)
Signed-off-by: Sébastien Han <seb@redhat.com>
site-docker.yml.sample

index b4db1d580a180c4f8b3573767f182771ea0cffeb..3725fea553fdf4751b410158c89de3dbb4fef7c3 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