Interview Prep/Ansible/Roles, Collections and Galaxy

How do you pin and upgrade role and collection versions safely?

IntermediateConceptRoles, Collections and Galaxy
Answer

Pin in requirements.yml (exact tag for roles, range or exact for collections), commit it, and upgrade deliberately via a pull request that runs your tests.

ansible-galaxy collection install -r requirements.yml --upgrade
ansible-galaxy collection list --format yaml

Read the collection changelog for breaking changes (removed modules, renamed parameters) before bumping a major version, run the playbook in check mode against staging, and keep the lock of installed versions in CI logs for traceability.

All Ansible questions Roadmap: Ansible

More on Roles, Collections and Galaxy