Interview Prep/Ansible/Roles, Collections and Galaxy

Installing from Private Automation Hub fails with `HTTP Code: 401, Message: Unauthorized`

IntermediateTroubleshootingRoles, Collections and Galaxy
Answer

Likely causes → The token is missing or expired, the URL points at the wrong repository (published or validated), or the server is not listed in server_list.

Fix →

[galaxy]
server_list = private_hub, release_galaxy

[galaxy_server.private_hub]
url = https://hub.internal/api/galaxy/content/published/
token = <set via env instead>

[galaxy_server.release_galaxy]
url = https://galaxy.ansible.com/

Supply the token through ANSIBLE_GALAXY_SERVER_PRIVATE_HUB_TOKEN from the CI secret store.

Prevent → Use long-lived service tokens stored in a secret manager, never in the committed ansible.cfg.

All Ansible questions Roadmap: Ansible

More on Roles, Collections and Galaxy