From c76501b8a3b0f1a307240222ee635035ea6c735f Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Mon, 24 Mar 2014 18:55:31 +0100 Subject: [PATCH] 'changed' key is not defined when task fails fix KeyError introduced by fix of #6591. --- lib/ansible/runner/action_plugins/template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/runner/action_plugins/template.py b/lib/ansible/runner/action_plugins/template.py index 34392ba5abd..44b8e62dda3 100644 --- a/lib/ansible/runner/action_plugins/template.py +++ b/lib/ansible/runner/action_plugins/template.py @@ -123,7 +123,7 @@ class ActionModule(object): return ReturnData(conn=conn, comm_ok=True, result=dict(changed=True), diff=dict(before_header=dest, after_header=source, before=dest_contents, after=resultant)) else: res = self.runner._execute_module(conn, tmp, 'copy', module_args, inject=inject, complex_args=complex_args) - if res.result['changed']: + if res.result.get('changed', False): res.diff = dict(before=dest_contents, after=resultant) return res else: