Pcornel
Automation · Ansible

Collections

Cheat sheet · https://pcornel.dk/topic.php?topic=5401

Back to the Topic

Answer

Ansible collections package namespaced modules, plugins, roles and documentation so automation content can declare and resolve dependencies beyond ansible-core.

Remember

  • Collection installed ≠ collection selected; FQCN and plugin routing determine actual resolution.
  • Same collection name ≠ same behavior across versions.
  • requirements file ≠ installed state; installation can drift from declared dependencies.
  • Local collection path ≠ CI/execution-environment path; content availability is environment-specific.

First checks

  • ansible-galaxy collection list — installed
  • ansible-galaxy collection install -r collections/requirements.yml — install pinned
  • requirements.yml with versions — pinning

Verify in this order

requirements.yml → install → modules available

Where it usually breaks

Collection installation proves content is present at a path; it does not prove the intended version is selected or compatible with the playbook/target.

Inventory/vars → play/task selection → connection/become → module request → module result → target object read-back → handler/service effective state → workload verification.

Collections Ansible boundary map

BoundaryHealthy evidenceSuspicious evidence
Inputs / selectionCorrect inventory, hosts, variables/facts and content are explicitWrong scope, stale facts, hidden precedence or content-version drift
ExecutionConnection, privilege, module/task context and ordering match intentUnreachable, wrong execution host, privilege/plugin failure or misleading skip/change state
Result semanticsPer-host/item results are preserved and interpreted correctlyAggregate recap hides partial/skipped/handled failures
Target proofResource/workload read-back and rerun confirm convergenceGreen Ansible status treated as end-to-end acceptance

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5401

Confirmation

Confirm action

Continue?