diff --git a/lib/ansible/plugins/callback/default.py b/lib/ansible/plugins/callback/default.py index 072eb5f4d2..e4f583db3d 100644 --- a/lib/ansible/plugins/callback/default.py +++ b/lib/ansible/plugins/callback/default.py @@ -150,11 +150,11 @@ class CallbackModule(CallbackBase): def v2_on_file_diff(self, result): if result._task.loop and 'results' in result._result: for res in result._result['results']: - if 'diff' in res and res['diff']: + if 'diff' in res and res['diff'] and res.get('changed', False): diff = self._get_diff(res['diff']) if diff: self._display.display(diff) - elif 'diff' in result._result and result._result['diff']: + elif 'diff' in result._result and result._result['diff'] and result._result.get('changed', False): diff = self._get_diff(result._result['diff']) if diff: self._display.display(diff)