1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix template module to fail if remote checksumming failed

This commit is contained in:
Toshio Kuratomi 2014-12-08 10:55:04 -08:00
parent b042fcc349
commit 2a288141d3

View file

@ -92,6 +92,11 @@ class ActionModule(object):
local_checksum = utils.checksum_s(resultant) local_checksum = utils.checksum_s(resultant)
remote_checksum = self.runner._remote_checksum(conn, tmp, dest, inject) 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: if local_checksum != remote_checksum:
# template is different from the remote value # template is different from the remote value