Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Checksums in Apache don't have filename #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hypery2k
Copy link

@hypery2k hypery2k commented Jan 10, 2024

Just supply the checksum string (without filename). Fixes this

fatal: [default]: FAILED! => {"changed": false, "msg": "Unable to find a checksum for file 'apache-maven-3.9.6-bin.tar.gz' in 'https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz.sha512'"})](fatal: [default]: FAILED! => {"changed": false, "msg": "Unable to find a checksum for file 'apache-maven-3.9.6-bin.tar.gz' in 'https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz.sha512'"}

@tecris
Copy link
Owner

tecris commented Jan 10, 2024

Hi Martin,
Thanks a lot for the PR 🙇

I would like to replicate the issue, can you please let me know what ansible version you used?
This could be a problem as the project specifies min_ansible_version: 2.4 however, molecule tests are using only latest ansible version 😬

cheers
eugen

@hypery2k
Copy link
Author

Hey Eugen,

sure, we're still using Ansible v7 in our project setup

@tecris
Copy link
Owner

tecris commented Jan 20, 2024

Hi Martin,

I used ansible-core 2.14 and could replicate the issue.
However, when I tested in your branch I run into another issue and after some investigation, unless I am wrong, the project uses an outdated download url.
Locally (didn't commit the change yet) in defaults/main.yml I updated maven_download_url to
maven_download_url: 'http://downloads.apache.org/maven/maven-{{ maven_major }}/{{ maven_version }}/binaries/{{ maven_file_name }}' and the issue was gone.
Can you please check on your side if you can still replicate the issue with this url? 🙇

cheers
eugen

@tecris
Copy link
Owner

tecris commented Jan 20, 2024

I was able to replicate the issue also with ansible-core 2.15 & 2.16
Download url is no longer valid and I was able to install the role using following steps:

# ansible-galaxy install tecris.ansible-maven
# ansible-playbook -i localhost, playbook.yml

# cat playbook.yml
- hosts: all
  connection: local
  roles:
    - role: tecris.ansible-maven
      maven_download_url: https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz

Download url taken from https://maven.apache.org/download.cgi

Please let me know if this works for you as well 🙇

If this works for you, I see this as a short term solution.
Long term is to update maven_download_url in defaults/main.yml. Long term as I intend to cut next release whenever maven releases.

cheers

@hypery2k
Copy link
Author

mmmh actually still getting this error:

: fatal: [default]: FAILED! => {"changed": false, "checksum_dest": null, "checksum_src": null, "dest": "/opt/apache-maven-3.9.6-bin.tar.gz", "elapsed": 0, "msg": "The checksum format is invalid", "url": " https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz"}

With my changes as proposed it works ....

@tecris
Copy link
Owner

tecris commented Jan 28, 2024

This is where CI/CD would help.
If I run molecule test in https://github.com/hypery2k/ansible-maven I also got

TASK [tecris.maven : Tell the world maven is not installed] ********************
ok: [debian_10] => {
    "msg": "Maven is not installed"
}

TASK [tecris.maven : Get Checksum] *********************************************
ok: [debian_10]

TASK [tecris.maven : Set Checksum fact] ****************************************
ok: [debian_10]

TASK [tecris.maven : Download Maven Binaries] **********************************
fatal: [debian_10]: FAILED! => {"changed": false, "checksum_dest": null, "checksum_src": null, "dest": "/opt/apache-maven-3.9.6-bin.tar.gz", "elapsed": 0, "msg": "The checksum format is invalid", "url": "http://www.apache.org/dist/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz"}

PLAY RECAP *********************************************************************
debian_10                  : ok=5    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=1   

Can you please

  1. drop the playbook content?
  2. drop output from ansible --version

thanks 🙇‍♂️

@hypery2k
Copy link
Author

hypery2k commented Feb 1, 2024

This is the output of ansible --version:

ansible [core 2.13.5]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/Users/mreinhardt/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/mreinhardt/Library/Python/3.9/lib/python/site-packages/ansible
  ansible collection location = /Users/mreinhardt/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/mreinhardt/Library/Python/3.8/bin/ansible
  python version = 3.9.6 (default, Dec  7 2023, 05:42:47) [Clang 15.0.0 (clang-1500.1.0.2.5)]
  jinja version = 3.1.2
  libyaml = True

@tecris
Copy link
Owner

tecris commented Feb 10, 2024

ansible-core 2.13 is no longer maintained,
https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix
For a better understanding I've done two tests with ansible-core 2.13.5 and ansible-core 2.14 with a modified maven_download_url as mentioned in #35 (comment)
I was able to replicate this issue with ansible-core 2.13.5, however, when using ansible-core 2.14 issue cannot be replicated.
Please let me know if you still have this issue with ansible-core 2.14. 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants