mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Don't log item data for skipped tasks under no_log
Tasks with `no_log` set should not log data. Remove log of item data for skipped tasks in loops Fix for #10387
This commit is contained in:
parent
241b905e85
commit
13a591eac0
1 changed files with 7 additions and 3 deletions
|
@ -873,9 +873,13 @@ class Runner(object):
|
||||||
for cond in self.conditional:
|
for cond in self.conditional:
|
||||||
|
|
||||||
if not utils.check_conditional(cond, self.basedir, inject, fail_on_undefined=self.error_on_undefined_vars):
|
if not utils.check_conditional(cond, self.basedir, inject, fail_on_undefined=self.error_on_undefined_vars):
|
||||||
result = utils.jsonify(dict(changed=False, skipped=True))
|
result = dict(changed=False, skipped=True)
|
||||||
|
if self.no_log:
|
||||||
|
result = utils.censor_unlogged_data(result)
|
||||||
|
self.callbacks.on_skipped(host, result)
|
||||||
|
else:
|
||||||
self.callbacks.on_skipped(host, inject.get('item',None))
|
self.callbacks.on_skipped(host, inject.get('item',None))
|
||||||
return ReturnData(host=host, result=result)
|
return ReturnData(host=host, result=utils.jsonify(result))
|
||||||
|
|
||||||
if getattr(handler, 'setup', None) is not None:
|
if getattr(handler, 'setup', None) is not None:
|
||||||
handler.setup(module_name, inject)
|
handler.setup(module_name, inject)
|
||||||
|
|
Loading…
Reference in a new issue