Switch to tripleo stdout callback

In order to improve the UX and prevent confusion during the async status
output, we need to write a custom callback to change the text.

See See also https://github.com/ansible/ansible/issues/63926

Change-Id: Ie3021ddfe1b4ca304cfd34a46fd4e4c7e9c62e9f
Depends-On: https://review.opendev.org/#/c/733399/
(cherry picked from commit b3c87dda23)
This commit is contained in:
Alex Schultz 2020-05-05 12:53:55 -06:00
parent f6010681f7
commit bf9b6c6697
2 changed files with 6 additions and 3 deletions

View File

@ -60,7 +60,7 @@ def write_default_ansible_cfg(work_dir,
'/usr/share/ansible/tripleo-plugins/callback:'
'/usr/share/ansible/plugins/callback:'
'%s/callback_plugins' % constants.DEFAULT_VALIDATIONS_BASEDIR)
callbacks_whitelist = ','.join(['profile_tasks'])
callbacks_whitelist = ','.join(['tripleo', 'profile_tasks'])
action_plugins_path = (
'~/.ansible/plugins/action:'
'/usr/share/ansible/plugins/action:'
@ -90,6 +90,7 @@ def write_default_ansible_cfg(work_dir,
config.set('defaults', 'library', modules_path)
config.set('defaults', 'callback_plugins', callbacks_path)
config.set('defaults', 'callback_whitelist', callbacks_whitelist)
config.set('defaults', 'stdout_callback', 'tripleo')
config.set('defaults', 'action_plugins', action_plugins_path)
config.set('defaults', 'lookup_plugins', lookups_path)
config.set('defaults', 'filter_plugins', filter_plugins_path)
@ -597,7 +598,8 @@ class AnsiblePlaybookAction(base.TripleOAction):
env_variables.update({
# the whitelist could be collected from multiple
# arguments if we find a use case for it
'ANSIBLE_CALLBACK_WHITELIST': 'profile_tasks',
'ANSIBLE_CALLBACK_WHITELIST': 'tripleo,profile_tasks',
'ANSIBLE_STDOUT_CALLBACK': 'tripleo',
'PROFILE_TASKS_TASK_OUTPUT_LIMIT':
six.text_type(self.profile_tasks_limit),
})

View File

@ -113,7 +113,8 @@ class AnsiblePlaybookActionTest(base.TestCase):
'HOME': action.work_dir,
'ANSIBLE_LOCAL_TEMP': action.work_dir,
'ANSIBLE_CONFIG': ansible_config_path,
'ANSIBLE_CALLBACK_WHITELIST': 'profile_tasks',
'ANSIBLE_CALLBACK_WHITELIST': 'tripleo,profile_tasks',
'ANSIBLE_STDOUT_CALLBACK': 'tripleo',
'PROFILE_TASKS_TASK_OUTPUT_LIMIT': '0',
}
python_version = sys.version_info.major