A 2 AM incident: a bad config went to all web servers. How do you roll back with Ansible?
AdvancedScenarioAWX, Cloud and Large-Scale Operations
Answer
Situation read → Fast, controlled rollback.
What I'd do →
- Check out the last known good commit/tag.
- Run the same playbook with
serialand the previous version variable. - Verify health; notify.
- Fix forward later through the normal pipeline.
git checkout v1.8.3
ansible-playbook deploy.yml -e app_version=1.8.3 --limit web
Why → Config as code means rollback is a redeploy of an older commit.
Interview tip → Keep previous release directories on the host for instant symlink rollback.
More on AWX, Cloud and Large-Scale Operations
Your company wants a self-service UI for running playbooks with RBAC. What do you propose?BeginnerHow do you run AWX on Kubernetes?BeginnerA job template should prompt for the target limit and a version, with validation.IntermediateYou need provisioning followed by configuration followed by an approval and then deploy.IntermediateA dynamic inventory source in AWX syncs slowly and stale hosts remain.IntermediateYou manage 5,000 servers and a single job takes hours.Advanced