Fix ansible-runner when verbosity is > 0

This change updates the run_ansible_playbook method to ensure that we're not
attempting to re-open the ansible runner stdout property when executing a
task with a verbosity setting of > 0. When the property is read the tmp file
has already been cleaned up resulting in stacktrace. There's no value in
re-opening the property as stdout is already been presented to the user so
the offending code has been deleted.

Change-Id: I4ab300e8a2a70adb1f79334aee44fde31d2cfa70
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This commit is contained in:
Kevin Carter 2020-01-27 11:47:10 -06:00 committed by Gael Chamoulaud (Strider)
parent f456ac9312
commit d8e0c5389c
No known key found for this signature in database
GPG Key ID: 4119D0305C651D66
1 changed files with 0 additions and 3 deletions

View File

@ -489,9 +489,6 @@ def run_ansible_playbook(playbook, inventory, workdir, playbook_dir=None,
runner = ansible_runner.Runner(config=runner_config)
status, rc = runner.run()
if verbosity > 1:
status = runner.stdout
if rc == 0:
LOG.info(
'Ansible execution success. playbook: {}'.format(