From 8e71b26264b335de9dd4d851fa26e5f44eba1654 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Tue, 25 Sep 2012 08:06:55 -0400 Subject: [PATCH] Fix up 'changed' playbook output patch --- lib/ansible/callbacks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/callbacks.py b/lib/ansible/callbacks.py index 44a6a4cb16d..60ad02af73b 100644 --- a/lib/ansible/callbacks.py +++ b/lib/ansible/callbacks.py @@ -310,7 +310,7 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks): host_result2 = host_result.copy() host_result2.pop('invocation', None) - changed = 'changed' in host_result2 or host_result['changed'] + changed = host_result.get('changed', False) ok_or_changed = 'ok' if changed: ok_or_changed = 'changed' @@ -319,7 +319,7 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks): msg = '' if not self.verbose or host_result2.get("verbose_override",None) is not None: if item: - msg = "ok: [%s] => (item=%s)" % (host, item) + msg = "%s: [%s] => (item=%s)" % (ok_or_changed, host, item) else: if 'ansible_job_id' not in host_result or 'finished' in host_result: msg = "%s: [%s]" % (ok_or_changed, host) @@ -329,7 +329,7 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks): msg = "%s: [%s] => (item=%s) => %s" % (ok_or_changed, host, item, utils.jsonify(host_result2)) else: if 'ansible_job_id' not in host_result or 'finished' in host_result2: - msg = "%s: [%s] => %s" % (host, utils.jsonify(host_result2)) + msg = "%s: [%s] => %s" % (ok_or_changed, host, utils.jsonify(host_result2)) if msg != '': if not changed: