(cherry picked from commit df6b8d2
)
Co-authored-by: Matt Martz <matt@sivel.net>
This commit is contained in:
parent
215aa73843
commit
978dd9f541
3 changed files with 5 additions and 2 deletions
3
changelogs/fragments/adhoc-command-async-output.yaml
Normal file
3
changelogs/fragments/adhoc-command-async-output.yaml
Normal file
|
@ -0,0 +1,3 @@
|
|||
bugfixes:
|
||||
- async - Fix async callback plugins to allow async output to be displayed
|
||||
when running command/shell (https://github.com/ansible/ansible/issues/15988)
|
|
@ -62,7 +62,7 @@ class CallbackModule(CallbackBase):
|
|||
color = C.COLOR_OK
|
||||
state = 'SUCCESS'
|
||||
|
||||
if result._task.action in C.MODULE_NO_JSON:
|
||||
if result._task.action in C.MODULE_NO_JSON and 'ansible_job_id' not in result._result:
|
||||
self._display.display(self._command_generic_msg(result._host.get_name(), result._result, state), color=color)
|
||||
else:
|
||||
self._display.display("%s | %s => %s" % (result._host.get_name(), state, self._dump_results(result._result, indent=4)), color=color)
|
||||
|
|
|
@ -64,7 +64,7 @@ class CallbackModule(CallbackBase):
|
|||
color = C.COLOR_OK
|
||||
state = 'SUCCESS'
|
||||
|
||||
if result._task.action in C.MODULE_NO_JSON:
|
||||
if result._task.action in C.MODULE_NO_JSON and 'ansible_job_id' not in result._result:
|
||||
self._display.display(self._command_generic_msg(result._host.get_name(), result._result, state), color=color)
|
||||
else:
|
||||
self._display.display("%s | %s => %s" % (result._host.get_name(), state, self._dump_results(result._result, indent=0).replace('\n', '')),
|
||||
|
|
Loading…
Reference in a new issue