Interview Prep/Ansible/Rolling Updates, Delegation and Orchestration

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 →

  1. serial: 1.
  2. Pre-check cluster health from the node or via delegation.
  3. Update, restart, wait for rejoin.
  4. 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.

All Ansible questions Roadmap: Ansible

More on Rolling Updates, Delegation and Orchestration