From bcb8fdc8030ab304829069063feffe1bc5858760 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Tue, 19 Dec 2017 15:10:05 +0100 Subject: [PATCH] site-docker: ability to disable fact sharing MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When deploying with Ansible at large scale, the delegate_facts method consumes a lot of memory on the host that is running Ansible. This can cause various issues like memory exhaustion on that machine. You can now run Ansible with "-e delegate_facts_host=False" to disable the fact sharing. Signed-off-by: Sébastien Han (cherry picked from commit c315f81dfe440945aaa90265cd3294fdea549942) Signed-off-by: Sébastien Han --- site-docker.yml.sample | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/site-docker.yml.sample b/site-docker.yml.sample index 6f3aef102..b4db1d580 100644 --- a/site-docker.yml.sample +++ b/site-docker.yml.sample @@ -17,11 +17,25 @@ gather_facts: false tasks: + + become: True + + vars: + delegate_facts_host: True + + pre_tasks: + - name: gather facts + setup: + when: + - not delegate_facts_host | bool + - name: gather and delegate facts setup: delegate_to: "{{ item }}" delegate_facts: True with_items: "{{ groups['all'] }}" + when: + - delegate_facts_host | bool - hosts: mons become: True -- 2.39.5