mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
clean debug output to match prev versions
This commit is contained in:
parent
a0842781a6
commit
be5488cb60
3 changed files with 8 additions and 0 deletions
|
@ -140,6 +140,12 @@ class CallbackBase:
|
|||
else:
|
||||
self.v2_playbook_item_on_ok(newres)
|
||||
|
||||
def _clean_results(self, result, task_name):
|
||||
if 'changed' in result and task_name in ['debug']:
|
||||
del result['changed']
|
||||
if 'invocation' in result and task_name in ['debug']:
|
||||
del result['invocation']
|
||||
|
||||
def set_play_context(self, play_context):
|
||||
pass
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ class CallbackModule(CallbackBase):
|
|||
|
||||
def v2_runner_on_ok(self, result):
|
||||
|
||||
self._clean_results(result._result, result._task.action)
|
||||
delegated_vars = result._result.get('_ansible_delegated_vars', None)
|
||||
if result._task.action == 'include':
|
||||
return
|
||||
|
|
|
@ -64,6 +64,7 @@ class CallbackModule(CallbackBase):
|
|||
self._display.display("%s | FAILED! => %s" % (result._host.get_name(), self._dump_results(result._result, indent=4)), color='red')
|
||||
|
||||
def v2_runner_on_ok(self, result):
|
||||
self._clean_results(result._result, result._task.action)
|
||||
if result._task.action in C.MODULE_NO_JSON:
|
||||
self._display.display(self._command_generic_msg(result._host.get_name(), result._result, "SUCCESS"), color='green')
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue