mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 14:41:23 -07:00
By popular request, make the no_log attribute also censor tasks from callbacks.
This commit is contained in:
parent
a04efa2d84
commit
99c39b1ff3
6 changed files with 61 additions and 3 deletions
|
@ -956,12 +956,17 @@ class Runner(object):
|
|||
if failed_when is not None and 'skipped' not in data:
|
||||
data['failed_when_result'] = data['failed'] = utils.check_conditional(failed_when, self.basedir, inject, fail_on_undefined=self.error_on_undefined_vars)
|
||||
|
||||
|
||||
if is_chained:
|
||||
# no callbacks
|
||||
return result
|
||||
if 'skipped' in data:
|
||||
self.callbacks.on_skipped(host, inject.get('item',None))
|
||||
elif not result.is_successful():
|
||||
|
||||
if self.no_log:
|
||||
data = utils.censor_unlogged_data(data)
|
||||
|
||||
if not result.is_successful():
|
||||
ignore_errors = self.module_vars.get('ignore_errors', False)
|
||||
self.callbacks.on_failed(host, data, ignore_errors)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue