From 9cc6007ecc9831d6b0232d3dc3b09541d474bc90 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Mon, 15 Feb 2021 11:58:21 -0700 Subject: [PATCH] Reduce fact gathering This change updates the default subset to only be the minimum list of facts for ansible. In the deployment we need to make sure that we only collect the minimum amount of facts to perform the tasks at hand rather than assume we have all the facts. Depends-On: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/775709 Depends-On: https://review.opendev.org/c/openstack/tripleo-ansible/+/775708 Related-Bug: #1915761 Change-Id: I61affe32dfc9eacbe514893168397c9b291b8713 (cherry picked from commit 0e81eb420e8974d7815b98e084a94885a1ff1b8b) --- tripleo_common/actions/ansible.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tripleo_common/actions/ansible.py b/tripleo_common/actions/ansible.py index 911a19779..46154e8aa 100644 --- a/tripleo_common/actions/ansible.py +++ b/tripleo_common/actions/ansible.py @@ -129,6 +129,9 @@ def write_default_ansible_cfg(work_dir, config.set('defaults', 'fact_caching', 'jsonfile') config.set('defaults', 'fact_caching_connection', '~/.ansible/fact_cache') + # NOTE(mwhahaha): only gather the bare minimum facts because this has + # direct impact on how fast ansible can go. + config.set('defaults', 'gather_subset', '!all,min') # Set the pull interval to lower CPU overhead config.set('defaults', 'internal_poll_interval', '0.05')