diff --git a/tripleoclient/tests/test_utils.py b/tripleoclient/tests/test_utils.py index 0fbb0bf4a..af2e49a68 100644 --- a/tripleoclient/tests/test_utils.py +++ b/tripleoclient/tests/test_utils.py @@ -76,6 +76,9 @@ class TestRunAnsiblePlaybook(TestCase): self.env['ANSIBLE_CONFIG'] = '/tmp/fooBar.cfg' self.env['ANSIBLE_HOST_KEY_CHECKING'] = 'False' self.env['ANSIBLE_LOG_PATH'] = '/tmp/ansible.log' + self.env['ANSIBLE_INJECT_FACT_VARS'] = 'False' + self.env['ANSIBLE_VARS_PLUGIN_STAGE'] = 'inventory' + self.env['ANSIBLE_GATHER_SUBSET'] = '!all,min' self.env['TRIPLEO_PLAN_NAME'] = 'overcloud' self.env['ANSIBLE_FORKS'] = '16' diff --git a/tripleoclient/utils.py b/tripleoclient/utils.py index 5c6be3efc..8e246b675 100644 --- a/tripleoclient/utils.py +++ b/tripleoclient/utils.py @@ -302,6 +302,11 @@ def run_ansible_playbook(logger, else: env['ANSIBLE_LOG_PATH'] = os.path.join(log_path_dir, 'ansible.log') + # Set var handling for better performance + env['ANSIBLE_INJECT_FACT_VARS'] = 'False' + env['ANSIBLE_VARS_PLUGIN_STAGE'] = 'inventory' + env['ANSIBLE_GATHER_SUBSET'] = '!all,min' + env['ANSIBLE_HOST_KEY_CHECKING'] = 'False' if gathering_policy in ['smart', 'explicit', 'implicit']: