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

What does `meta: end_batch` or `end_host` give you in rollouts?

BeginnerProductionRolling Updates, Delegation and Safe Deployments
Answer

They let a play stop part of its work without failing. end_host removes the current host from the rest of the play, for example when it is already on the target version. end_batch ends the current serial batch and moves to the next one. end_play stops everything cleanly.

- ansible.builtin.meta: end_host
  when: installed_version == app_version

This keeps re-runs fast and avoids deeply nested when conditions on every task.

All Ansible questions Roadmap: Ansible

More on Rolling Updates, Delegation and Safe Deployments