Skip to content
Latchkey

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

  1. Verify the exact collection name and a published version.
  2. Pin the version in requirements.yml.
  3. 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 list

How 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →