Interview Prep/Ansible/Roles, Collections and Project Structure

How do you pin Ansible itself so a CI run today behaves like one last month?

IntermediateScenarioRoles, Collections and Project Structure
Answer

Situation read → Tool-version drift.

What I'd do →

  1. Pin ansible-core and Python dependencies in requirements.txt (and lock hashes).
  2. Pin collections in requirements.yml.
  3. Better, bake both into an Execution Environment image or a container used by CI.
ansible-core==2.17.*

Why → Module behaviour changes between versions; a floating install makes failures irreproducible.

Interview tip → Say you upgrade deliberately on a schedule with a test run.

All Ansible questions Roadmap: Ansible

More on Roles, Collections and Project Structure