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
get_url failes to recognize checksum format with url #48847
Comments
Hi @lucastheisen, thank you for submitting this issue! |
Files identified in the description: If these files are inaccurate, please update the |
checksum="sha256:http://example.com/path/sha256sum.txt" sha256sum.txt just support the format [ filename: checksum ]. In your case, you could use [ checksum="sha256:D98291AC[...]B6DC7B97" ]. |
This should be a feature available natively from the @lucastheisen as a "native ansible workaround" to download This should apply to other downloads e.g. You can run it copy/pasting the command in the comment at the beginning of the playbook. This work on Linux (pay attention to stuff like paths e.g. # reference
# - https://learn.hashicorp.com/terraform/getting-started/install.html
# - https://www.terraform.io/downloads.html
---
# ansible-playbook setup-terraform.yaml -i "localhost," -vvvv --extra-vars "cli_input_username=<YOUR_USERNAME_HERE>" --connection=local
- name: Make sure Terraform is installed
hosts: all
vars:
user_name: "{{ cli_input_username }}"
tf_version: 0.11.10
vars_prompt:
- name: "ansible_become_pass"
prompt: "Sudo password"
private: yes
become: yes
tasks:
- name: Download the Terraform checksum
get_url:
url: https://releases.hashicorp.com/terraform/{{ tf_version }}/terraform_{{ tf_version }}_SHA256SUMS
dest: /home/{{ user_name }}/src/terraform_{{ tf_version }}_SHA256SUMS
- name: Register the checksum value
shell: cat /home/{{ user_name }}/src/terraform_{{ tf_version }}_SHA256SUMS | grep linux_amd64.zip | awk '{ print $1 }'
register: tf_checksum_value
- name: Download the Terraform archive
get_url:
url: https://releases.hashicorp.com/terraform/{{ tf_version }}/terraform_{{ tf_version }}_linux_amd64.zip
dest: /home/{{ user_name }}/src/terraform_{{ tf_version }}_linux_amd64.zip
checksum: sha256:{{ tf_checksum_value.stdout }} |
Here is a workaround. And I agree with abadger's opinion. I must admit that it was unwise to support remote checksum files . |
wontfix |
SUMMARY
I am attempting to install golang using the guidelines from their documentation. One of my steps is to download the official tarball:
However, doing so results in this error:
As you can see, the checksum is
sha256:https://dl.google.com/go/go1.11.2.linux-amd64.tar.gz.sha256
which is clearly of the documented format<algorithm>:<checksum|url>
ISSUE TYPE
COMPONENT NAME
get_url
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
I'm running:
Inside WSL on Windows:
STEPS TO REPRODUCE
Just run the following playbook
EXPECTED RESULTS
Expected the go tarball to be downloaded into
/opt/ansible
ACTUAL RESULTS
Failed due to invalid checksum parameter format.
The text was updated successfully, but these errors were encountered: