From 2a288141d3d3ea709d83772b431f6d58dae22198 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Mon, 8 Dec 2014 10:55:04 -0800 Subject: [PATCH] Fix template module to fail if remote checksumming failed --- lib/ansible/runner/action_plugins/template.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ansible/runner/action_plugins/template.py b/lib/ansible/runner/action_plugins/template.py index fd38c610631..15e8e3a9a00 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