How do you release and promote Ansible changes across environments?
AdvancedProductionProject Structure and Design
Answer
Treat the repo as a versioned artifact. A merge to main is tagged (v2025.11.3), and the pipeline promotes the same tag through dev, stage and prod, so what was tested is exactly what runs in prod. AWX project is pinned to the tag or commit SHA for prod, not the moving main branch.
Execution environment images are tagged in step with the code, so collection versions match. Rollback means re-running the previous tag, which works because plays are idempotent, though it does not undo non-reversible changes such as database migrations.
More on Project Structure and Design
What does a production Ansible repository look like?BeginnerMonorepo or separate repos for roles? How do you decide?IntermediateHow do you structure inventories for dev, stage and prod?BeginnerHow do you prevent someone from running a playbook against production by accident?IntermediateWhat does "thin playbooks, fat roles" mean?IntermediateWhat makes a well-designed role?Intermediate