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

Use ANSIBLE_BASE_JWT_KEY to make Galaxy aware of Envoy #2102

Merged

Conversation

bmclaughlin
Copy link
Contributor

Specifically in the case of downloading collections.

Before:

$ ansible-galaxy collection download -p . awx.awx -s https://localhost/api/hub/content/community/ --api-key=<INSERT_KEY_HERE> --ignore-certs --no-cache
Process download dependency map
Starting collection download process to '/home/bmclaugh/Downloads/_tmp'
Downloading http://localhost:5001/api/hub/v3/plugin/ansible/content/community/collections/artifacts/awx-awx-24.0.0.tar.gz to /home/bmclaugh/.ansible/tmp/ansible-local-3030078ycyczlke/tmpzw38d1oq/awx-awx-24.0.0-if08m8a7
Downloading collection 'awx.awx:24.0.0' to '/home/bmclaugh/Downloads/'
ERROR! Failed to download collection tar from 'cmd_arg' due to the following unforeseen error: HTTP Error 404: Not Found. HTTP Error 404: Not Found

After:

$ ansible-galaxy collection download -p . awx.awx -s https://localhost/api/hub/content/community/ --api-key=<INSERT_KEY_HERE> --ignore-certs --no-cache
Process download dependency map
Starting collection download process to '/home/bmclaugh/Downloads'
Downloading https://localhost/api/hub/v3/plugin/ansible/content/community/collections/artifacts/awx-awx-24.0.0.tar.gz to /home/bmclaugh/.ansible/tmp/ansible-local-2970413jpwpnnso/tmpbpkvb8my/awx-awx-24.0.0-nb1v7e1z
Downloading collection 'awx.awx:24.0.0' to '/home/bmclaugh/Downloads'
Collection 'awx.awx:24.0.0' was downloaded successfully
Writing requirements.yml file of downloaded collections to '/home/bmclaugh/Downloads/requirements.yml'

AAP-20998
No-Issue

@github-actions github-actions bot added backport-4.2 This PR should be backported to stable-4.2 (1.2) backport-4.4 This PR should be backported to stable-4.4 (2.1) backport-4.5 This PR should be backported to stable-4.5 (2.2) backport-4.6 This PR should be backported to stable-4.6 (2.3) backport-4.7 This PR should be backported to stable-4.7 (2.4) backport-4.8 This PR should be backported to stable-4.8 (2.4) backport-4.9 This PR should be backported to stable-4.9 (2.4) labels Mar 21, 2024
@bmclaughlin bmclaughlin removed backport-4.2 This PR should be backported to stable-4.2 (1.2) backport-4.4 This PR should be backported to stable-4.4 (2.1) backport-4.5 This PR should be backported to stable-4.5 (2.2) backport-4.6 This PR should be backported to stable-4.6 (2.3) backport-4.7 This PR should be backported to stable-4.7 (2.4) backport-4.8 This PR should be backported to stable-4.8 (2.4) backport-4.9 This PR should be backported to stable-4.9 (2.4) labels Mar 21, 2024
@rochacbruno
Copy link
Member

/retest

@newswangerd newswangerd changed the title Use ANSIBLE_BASE_JWT_KEY to make Galaxy aware of Gateway Use ANSIBLE_BASE_JWT_KEY to make Galaxy aware of Envoy Mar 27, 2024
@bmclaughlin bmclaughlin force-pushed the aap-20998-download-collections branch from 4251458 to d170e6e Compare April 2, 2024 16:54
@bmclaughlin bmclaughlin force-pushed the aap-20998-download-collections branch from d170e6e to 7bdf8dd Compare April 2, 2024 17:29
"ANSIBLE_API_HOSTNAME": settings.get("ANSIBLE_API_HOSTNAME"),
"ANSIBLE_CONTENT_HOSTNAME": settings.get("ANSIBLE_CONTENT_HOSTNAME"),
}
gw_url = urlparse(ANSIBLE_BASE_JWT_KEY)
Copy link
Member

@rochacbruno rochacbruno Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So ANSIBLE_BASE_JWT_KEY is actually a URL string? or a key?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

David commented on the jira issue (here's the excerpt) ANSIBLE_BASE_JWT_KEY which can either be a URL or a key file. If ANSIBLE_BASE_JWT_KEY is a key the scheme and hostname will not be populated in the following check and nothing should change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I think it is good to add a comment so the future us will know about it when dealing with this piece of code :)

# The following variable is either a URL or a key file path.
ANSIBLE_BASE_JWT_KEY = settings.get("ANSIBLE_BASE_JWT_KEY") 

@bmclaughlin
Copy link
Contributor Author

/retest

@bmclaughlin bmclaughlin merged commit 3ed26c9 into ansible:master Apr 25, 2024
26 of 28 checks passed
@bmclaughlin bmclaughlin deleted the aap-20998-download-collections branch April 25, 2024 15:38
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.

3 participants