From d46af7cda386b791ec20e8fe6bac466615f334e6 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Fri, 1 Apr 2016 18:03:51 +0200 Subject: [PATCH] On change in diff-mode we don't need to see file content in task output I was surprised to see complete file content in the (JSON) task output when in diff-mode. Since we see the diff anyhow, there's no need to send everything on screen. --- lib/ansible/plugins/callback/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/plugins/callback/__init__.py b/lib/ansible/plugins/callback/__init__.py index 61cae7b7ba5..903bc53014c 100644 --- a/lib/ansible/plugins/callback/__init__.py +++ b/lib/ansible/plugins/callback/__init__.py @@ -99,6 +99,10 @@ class CallbackBase: if not keep_invocation and self._display.verbosity < 3 and 'invocation' in result: del abridged_result['invocation'] + # remove diff information from screen output + if self._display.verbosity < 3 and 'diff' in result: + del abridged_result['diff'] + return json.dumps(abridged_result, indent=indent, ensure_ascii=False, sort_keys=sort_keys) def _handle_warnings(self, res):