From 3366a95765668d9a8fd915e2e21c41a43c598321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Matu=C5=A1ka?= Date: Mon, 12 Sep 2016 07:45:46 +0200 Subject: [PATCH] Force download if checksums do not match (#4262) --- lib/ansible/modules/network/basics/get_url.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ansible/modules/network/basics/get_url.py b/lib/ansible/modules/network/basics/get_url.py index 0dabf982d0e..cd9f3880cf1 100644 --- a/lib/ansible/modules/network/basics/get_url.py +++ b/lib/ansible/modules/network/basics/get_url.py @@ -364,6 +364,11 @@ def main(): mtime = os.path.getmtime(dest) last_mod_time = datetime.datetime.utcfromtimestamp(mtime) + # If the checksum does not match we have to force the download + # because last_mod_time may be newer than on remote + if checksum_mismatch: + force = True + # download to tmpsrc tmpsrc, info = url_get(module, url, dest, use_proxy, last_mod_time, force, timeout, headers, tmp_dest)