From 513619867a56732885d7e74e5edbfd64500d34b7 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Tue, 22 Sep 2015 08:45:04 -0400 Subject: [PATCH] Show delegated-to host in callback message Fixes #12465 --- lib/ansible/plugins/callback/default.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/callback/default.py b/lib/ansible/plugins/callback/default.py index e7485f56dab..a936e421bd5 100644 --- a/lib/ansible/plugins/callback/default.py +++ b/lib/ansible/plugins/callback/default.py @@ -61,10 +61,16 @@ class CallbackModule(CallbackBase): msg = 'included: %s for %s' % (result._task.args.get('_raw_params'), result._host.name) color = 'cyan' elif result._result.get('changed', False): - msg = "changed: [%s]" % result._host.get_name() + if result._task.delegate_to is not None: + msg = "changed: [%s => %s]" % (result._host.get_name(), result._task.delegate_to) + else: + msg = "changed: [%s]" % result._host.get_name() color = 'yellow' else: - msg = "ok: [%s]" % result._host.get_name() + if result._task.delegate_to is not None: + msg = "ok: [%s => %s]" % (result._host.get_name(), result._task.delegate_to) + else: + msg = "ok: [%s]" % result._host.get_name() color = 'green' if result._task.loop and 'results' in result._result: