Open cdm-arm opened 2 years ago
Looks like a good addition, but; it's not idempotent. I guess this tasks is the issue.
Good intention, bad implementation. I changed the way, now utilising the sha512 hashes that Apache anyhow provides.
Very nice feature @aek-arm and exactly what I was looking for, thanks for posting :)
I think this may pass the CI-actions if the sections with {{ tomcat_directory }}/
is changed to {{ tomcat_directory }}/{{ instance.name }}
I ran a local version with
- name: stop instance for upgrade
service:
name: "{{ instance.name }}"
state: stopped
when: slurped_sha512hash.content is defined
at the beginning of the block to avoid any issues with removing stuff during running and checksum for the url seem to fail for older ansible versions, so I use
checksum: "sha512:{{ tomcat_download_sha512 | regex_replace('\\s[*].+$','') }}}}"
instead.
name: Pull request about: This is related to #22 and allows the tomcat role to verify if a newer version was downloaded and upgrade the instance.
Describe the change Calculate the sha1 of the tomcat tarball and verify it with the sha1 of the freshly downloaded tarball. If there is a difference the instance bin folder gets removed to trigger the extracting of the new tarball
Testing Manually tested playbook with: