Browse Source

Merge "Revert "Revert "Add environment variables for better var handling""" into stable/train

changes/16/784416/1 12.5.0
Zuul 3 weeks ago
committed by Gerrit Code Review
parent
commit
1a88932ff9
2 changed files with 8 additions and 0 deletions
  1. +3
    -0
      tripleoclient/tests/test_utils.py
  2. +5
    -0
      tripleoclient/utils.py

+ 3
- 0
tripleoclient/tests/test_utils.py 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'


+ 5
- 0
tripleoclient/utils.py 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']:


Loading…
Cancel
Save