diff --git a/v2/ansible/plugins/callback/default.py b/v2/ansible/plugins/callback/default.py index 262303dc57..de6548ef18 100644 --- a/v2/ansible/plugins/callback/default.py +++ b/v2/ansible/plugins/callback/default.py @@ -37,6 +37,8 @@ class CallbackModule(CallbackBase): pass def v2_runner_on_failed(self, result, ignore_errors=False): + if 'exception' in result._result and self._display.verbosity < 3: + del result._result['exception'] self._display.display("fatal: [%s]: FAILED! => %s" % (result._host.get_name(), json.dumps(result._result, ensure_ascii=False)), color='red') def v2_runner_on_ok(self, result): diff --git a/v2/ansible/plugins/callback/minimal.py b/v2/ansible/plugins/callback/minimal.py index 4e9c8fffd2..c6b2282e62 100644 --- a/v2/ansible/plugins/callback/minimal.py +++ b/v2/ansible/plugins/callback/minimal.py @@ -38,6 +38,8 @@ class CallbackModule(CallbackBase): pass def v2_runner_on_failed(self, result, ignore_errors=False): + if 'exception' in result._result and self._display.verbosity < 3: + del result._result['exception'] self._display.display("%s | FAILED! => %s" % (result._host.get_name(), result._result), color='red') def v2_runner_on_ok(self, result):