Interview Prep/Ansible/Rolling Updates, Delegation and Safe Deployments

What happens to a rollout if a host fails halfway, and how do you resume?

BeginnerProductionRolling Updates, Delegation and Safe Deployments
Answer

The failed host is dropped from the rest of the play, the other hosts in the batch continue, and the failure counts toward max_fail_percentage. Hosts that already finished remain updated, which is why the plays must be idempotent and safe to re-run.

Fix the cause, then re-run only the failed hosts: ansible-playbook deploy.yml --limit @deploy.retry (when retry files are enabled) or by name. AWX offers "relaunch on failed hosts". Resume does not need special logic if each host's change is idempotent.

All Ansible questions Roadmap: Ansible

More on Rolling Updates, Delegation and Safe Deployments