Interview Prep/Real-World Interview/Deployments and releases

An Ansible playbook run during a deploy failed on 3 of 20 servers. What state is the fleet in and what do you do?

IntermediateScenarioDeployments and releases
Answer

Situation read → You have a mixed fleet: some servers on the new version, some partially changed. Mixed is dangerous if the versions are incompatible.

What I'd do →

  1. Read the play recap and the failed tasks; Ansible writes failed hosts to a retry file if retry_files_enabled is on, otherwise copy them from the recap.
  2. Take the 3 failed hosts out of the load balancer.
  3. Fix the cause (disk full, package repo timeout, a service that didn't start) and rerun only on them:
ansible-playbook deploy.yml --limit @deploy.retry
# or
ansible-playbook deploy.yml --limit web07,web12,web15
  1. Idempotent playbooks make the rerun safe; that's the payoff of writing them properly.
  2. Next time, use serial: 5 with max_fail_percentage: 10 so a failure stops the rollout early instead of hitting the whole fleet.

Why → serial turns a fleet-wide deploy into batches, which is a rolling update for VMs.

Interview tip → Mention serial and max_fail_percentage.

All Real-World Interview questions Roadmap: Interview readiness

More on Deployments and releases