diff --git a/lib/ansible/modules/net_tools/basics/get_url.py b/lib/ansible/modules/net_tools/basics/get_url.py index 6b387635e02..d589f238d86 100644 --- a/lib/ansible/modules/net_tools/basics/get_url.py +++ b/lib/ansible/modules/net_tools/basics/get_url.py @@ -538,6 +538,8 @@ def main(): changed = True else: changed = False + if os.path.exists(tmpsrc): + os.remove(tmpsrc) if checksum != '': destination_checksum = module.digest_from_file(dest, algorithm)