Revert "Revert "Add environment variables for better var handling""

This reverts commit 6aa5a92e35.

We'd like to disable the fact var inject but we need to address the
ceph-ansible execution issues. This change now has depends-on for CI
coverage and a workaround for ceph-ansible requirements until
ceph-ansible can be updated.

Depends-On: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/782550

Change-Id: Ia67f51097e7853a5810217a3effc37c45b010f3c
Related-Bug: #1915761
(cherry picked from commit c6380a6073)
This commit is contained in:
Alex Schultz 2021-03-04 07:51:31 -07:00
parent 7536d5b8e0
commit 8bcbc09d3d
2 changed files with 8 additions and 0 deletions

View File

@ -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'

View File

@ -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']: