Yes. The checksum parameter looks like it would be part of the solution. But that assumes I already have a checksum?
How do I get it? How does ansible get the checksum of the updated remote file? How do I know if they are the same kind of checksums?
ChatGPT suggested something like this:
- name: Check the checksum of the remote file
uri:
url: "{{ archive_url }}"
return_content: no
method: HEAD
register: remote_file
- name: Download the file if the checksum has changed
get_url:
url: "{{ archive_url }}"
dest: "{{ java_home }}"
checksum: "{{ remote_file.headers['Content-MD5'] }}"
When I try that, ansible tells me that the remote_file dict does not have a headers entry.