You must update a cluster where only one node can be down at a time and you must know the quorum is healthy before the next node.
AdvancedScenarioRolling Updates, Delegation and Orchestration
Answer
Situation read → Stateful clusters (etcd, Kafka, Elasticsearch).
What I'd do →
serial: 1.- Pre-check cluster health from the node or via delegation.
- Update, restart, wait for rejoin.
- Post-check health; fail the play otherwise.
- ansible.builtin.uri:
url: "http://{{ inventory_hostname }}:9200/_cluster/health"
return_content: true
register: ch
until: ch.json.status == 'green'
retries: 60
delay: 10
Why → The gate prevents a second node going down while the cluster is still recovering.
Interview tip → Mention disabling shard allocation first for Elasticsearch.
More on Rolling Updates, Delegation and Orchestration
You must deploy a new app version to 40 web servers behind a load balancer with zero downtime.AdvancedWhat does `serial: [1, 5, "50%"]` do?BeginnerDuring a rolling update, 3 of 10 hosts in a batch fail. Does the play continue?IntermediateYou must restart database replicas one at a time but never the primary first.AdvancedYou need a task to run on the LB for every web host, without logging into each web host.IntermediateA shell command must run on localhost for each remote host, e.g. a CLI call to a cloud API.Beginner