ansible-galaxy "collection was not found" installing requirements in CI
ansible-galaxy resolves collections from Galaxy or configured servers. When a requirements entry names a collection that does not exist at that version or source, the install fails and downstream playbooks cannot resolve its modules.
What this error means
ansible-galaxy collection install fails with "ERROR! Collection namespace.name was not found on the Galaxy server" or "does not have the version X.Y.Z".
ansible-galaxy
ERROR! Collection community.docker was not found on the Galaxy server
https://galaxy.ansible.com or the version '99.0.0' does not exist.Common causes
A wrong collection name or version in requirements.yml
A typo in the namespace/name or a version that was never published makes Galaxy return not found.
The source server is unreachable or wrong
A private automation hub or a proxy that is down, or a missing server config, prevents resolution.
How to fix it
Correct requirements.yml and install
- Verify the exact collection name and a published version.
- Pin the version in
requirements.yml. - Run the install from the file.
requirements.yml
# requirements.yml
collections:
- name: community.docker
version: ">=3.0.0"Install and confirm
Install collections from the file, then verify they are present.
Terminal
ansible-galaxy collection install -r requirements.yml
ansible-galaxy collection listHow to prevent it
- Pin collection versions in requirements.yml.
- Install requirements as a first CI step before playbooks or Molecule.
- Verify server configuration for private hubs.
Related guides
ansible-galaxy authentication failed (ANSIBLE_GALAXY_TOKEN) in CIFix ansible-galaxy 401/403 authentication failures in CI - installing or publishing to a private automation h…
Ansible "couldn't resolve module/action" in CIFix Ansible "couldn't resolve module/action" in CI - the module belongs to a collection that is not installed…
ansible-lint "syntax-check[specific]" failure in CIFix ansible-lint "syntax-check[specific]" in CI - ansible-lint ran ansible playbook --syntax-check and it fai…