From 936bd83614d3db3ee36c92e8a8d2168269ec3bc8 Mon Sep 17 00:00:00 2001 From: akatch Date: Sat, 15 Feb 2020 06:48:05 -0600 Subject: [PATCH] Fix duplicate log entries (and add item support for failures) (#66098) --- lib/ansible/plugins/callback/unixy.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ansible/plugins/callback/unixy.py b/lib/ansible/plugins/callback/unixy.py index 253b4e3d2af..5fa24eb35a8 100644 --- a/lib/ansible/plugins/callback/unixy.py +++ b/lib/ansible/plugins/callback/unixy.py @@ -122,6 +122,9 @@ class CallbackModule(CallbackModule_default): self._preprocess_result(result) display_color = C.COLOR_ERROR msg = "failed" + item_value = self._get_item_label(result._result) + if item_value: + msg += " | item: %s" % (item_value,) task_result = self._process_result_output(result, msg) self._display.display(" " + task_result, display_color, stderr=self.display_failed_stderr) @@ -132,6 +135,9 @@ class CallbackModule(CallbackModule_default): result_was_changed = ('changed' in result._result and result._result['changed']) if result_was_changed: msg = "done" + item_value = self._get_item_label(result._result) + if item_value: + msg += " | item: %s" % (item_value,) display_color = C.COLOR_CHANGED task_result = self._process_result_output(result, msg) self._display.display(" " + task_result, display_color)