summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2014-12-08 10:55:04 -0800
committerJames Cammarata <jimi@sngx.net>2015-02-17 13:34:33 -0600
commitfc638fd37174f28806b34c789ec305dfa035785e (patch)
tree4cae681246c5cd627f27a1795efe66c9fb825be8
parent3a68c098881b4484f438112c90ce1eb71f2003e7 (diff)
downloadansible-fc638fd37174f28806b34c789ec305dfa035785e.tar.gz
Fix template module to fail if remote checksumming failed
-rw-r--r--lib/ansible/runner/action_plugins/template.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ansible/runner/action_plugins/template.py b/lib/ansible/runner/action_plugins/template.py
index fd38c61063..15e8e3a9a0 100644
--- a/lib/ansible/runner/action_plugins/template.py
+++ b/lib/ansible/runner/action_plugins/template.py
@@ -92,6 +92,11 @@ class ActionModule(object):
local_checksum = utils.checksum_s(resultant)
remote_checksum = self.runner._remote_checksum(conn, tmp, dest, inject)
+ if remote_checksum in ('0', '1', '2', '3', '4'):
+ result = dict(failed=True, msg="failed to checksum remote file."
+ " Checksum error code: %s" % remote_checksum)
+ return ReturnData(conn=conn, comm_ok=True, result=result)
+
if local_checksum != remote_checksum:
# template is different from the remote value