From dcc0a2d5966fa2d05d6e9dff0af0059c5991ce51 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Mon, 8 Feb 2016 22:05:46 -0800 Subject: [PATCH] Also hide the before state of files with --diff and no_log --- lib/ansible/plugins/action/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index a93e8b41c3d..f6a914097c3 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -611,7 +611,10 @@ class ActionBase(with_metaclass(ABCMeta, object)): diff['after_header'] = 'dynamically generated' diff['after'] = source - if self._play_context.no_log and 'after' in diff: - diff["after"] = " [[ Diff output has been hidden because 'no_log: true' was specified for this result ]]" + if self._play_context.no_log: + if 'before' in diff: + diff["before"] = "" + if 'after' in diff: + diff["after"] = " [[ Diff output has been hidden because 'no_log: true' was specified for this result ]]" return diff