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

fetch checksum with auth #83286

Closed
1 task done
yukha-dw opened this issue May 21, 2024 · 4 comments
Closed
1 task done

fetch checksum with auth #83286

yukha-dw opened this issue May 21, 2024 · 4 comments
Assignees
Labels
module This issue/PR relates to a module. question

Comments

@yukha-dw
Copy link

yukha-dw commented May 21, 2024

Summary

I am unable to use checksum parameter on ansible.builtin.get_url because it's located on protected artifactory.

Issue Type

Feature Idea
Bug

Component Name

get_url

Additional Information

I'd be great if ansible also use url_username & url_password to fetch the checksum (or new parameters would be great too). Running get_url twice is ok, but checksum only accepts url or string, I have to run command to extract the sha

- name: download package from protected artifactory
  ansible.builtin.get_url:
    url: "https://protected-artifactory/package/package.deb"
    checksum: "sha256:https://protected-artifactory/package/package.deb.sha256"
    dest: /package.deb
    url_username: "{{ artifactory_id }}"
    url_password: "{{ artifactory_api_key }}"

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibot ansibot added feature This issue/PR relates to a feature request. needs_triage Needs a first human triage before being processed. module This issue/PR relates to a module. labels May 21, 2024
@ansibot
Copy link
Contributor

ansibot commented May 21, 2024

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the component bot command.

@bcoca bcoca added P3 Priority 3 - Approved, No Time Limitation bug This issue/PR relates to a bug. and removed needs_triage Needs a first human triage before being processed. feature This issue/PR relates to a feature request. labels May 21, 2024
@yukha-dw
Copy link
Author

additional workaround is to use lookup + ansible.builtin.url

checksum: "sha256:{{ lookup('ansible.builtin.url', 'https://protected-artifactory/package/package.deb.sha256', username=artifactory_id, password=artifactory_api_key, force_basic_auth='True') }}"

@Akasurde
Copy link
Member

Akasurde commented May 23, 2024

@yukha-dw get_url uses url_username and url_password for downloading checksum URL and the actual file. Do you have a different username, and password for the checksum and actual file?

@yukha-dw
Copy link
Author

@Akasurde After reading your comment, I have tested it and some reason it's working as expected now. Thank you, there must be a mistake in my previous attempt

@Akasurde Akasurde self-assigned this May 24, 2024
@Akasurde Akasurde added question and removed bug This issue/PR relates to a bug. P3 Priority 3 - Approved, No Time Limitation labels May 24, 2024
@ansible ansible locked as resolved and limited conversation to collaborators May 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
module This issue/PR relates to a module. question
Projects
None yet
Development

No branches or pull requests

4 participants