fix tempating issues with no_log and loops (#44468)

* fix tempating issues with no_log and loops

 - task is no log if any item is
 - added test cases

fixes #43294
This commit is contained in:
Brian Coca 2018-08-21 21:53:56 -04:00 committed by GitHub
commit bda074d34e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 4 deletions

View file

@ -111,7 +111,7 @@ class TaskResult:
else:
ignore = _IGNORE
if self._task.no_log or self._result.get('_ansible_no_log', False):
if isinstance(self._task.no_log, bool) and self._task.no_log or self._result.get('_ansible_no_log', False):
x = {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"}
# preserve full