Interview Prep/Ansible/Rolling Updates, Delegation and Orchestration

A deployment should run strictly one host at a time, but fact gathering should not be slow.

IntermediateScenarioRolling Updates, Delegation and Orchestration
Answer

Situation read → serial: 1 gathers facts per batch, increasing wall time.

What I'd do → Gather facts in a first play for all hosts, then run the serial play with gather_facts: false, or with cached facts.

- hosts: web
  gather_facts: true
  tasks: []
- hosts: web
  serial: 1
  gather_facts: false

Why → Facts are collected in parallel once, not 40 times sequentially.

Interview tip → Facts live in memory for the whole run, so the second play still sees them.

All Ansible questions Roadmap: Ansible

More on Rolling Updates, Delegation and Orchestration