correctly deal with changed (#31812)
This commit is contained in:
parent
5751b9b224
commit
21cdddce74
3 changed files with 7 additions and 2 deletions
|
@ -10,7 +10,7 @@ from copy import deepcopy
|
||||||
from ansible.parsing.dataloader import DataLoader
|
from ansible.parsing.dataloader import DataLoader
|
||||||
from ansible.vars.manager import strip_internal_keys
|
from ansible.vars.manager import strip_internal_keys
|
||||||
|
|
||||||
_IGNORE = ('changed', 'failed', 'skipped')
|
_IGNORE = ('failed', 'skipped')
|
||||||
|
|
||||||
|
|
||||||
class TaskResult:
|
class TaskResult:
|
||||||
|
|
|
@ -218,7 +218,10 @@ class CallbackBase(AnsiblePlugin):
|
||||||
|
|
||||||
def _clean_results(self, result, task_name):
|
def _clean_results(self, result, task_name):
|
||||||
''' removes data from results for display '''
|
''' removes data from results for display '''
|
||||||
pass
|
if task_name in ['debug']:
|
||||||
|
for remove_key in ('invocation'):
|
||||||
|
if remove_key in result:
|
||||||
|
del result[remove_key]
|
||||||
|
|
||||||
def set_play_context(self, play_context):
|
def set_play_context(self, play_context):
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -95,6 +95,8 @@ class CallbackModule(CallbackBase):
|
||||||
else:
|
else:
|
||||||
|
|
||||||
if (self._display.verbosity > 0 or '_ansible_verbose_always' in result._result) and '_ansible_verbose_override' not in result._result:
|
if (self._display.verbosity > 0 or '_ansible_verbose_always' in result._result) and '_ansible_verbose_override' not in result._result:
|
||||||
|
if result._task.action == 'debug' and 'changed' in result._result:
|
||||||
|
del result._result['changed']
|
||||||
msg += " => %s" % (self._dump_results(result._result),)
|
msg += " => %s" % (self._dump_results(result._result),)
|
||||||
self._display.display(msg, color=color)
|
self._display.display(msg, color=color)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue