Interview Prep/Ansible/Rolling Updates, Delegation and Orchestration

You must run a play on hosts in a certain order, such as db, then app, then web.

BeginnerScenarioRolling Updates, Delegation and Orchestration
Answer

Situation read → Tier ordering.

What I'd do → Use several plays in one playbook in that order.

- import_playbook: db.yml
- import_playbook: app.yml
- import_playbook: web.yml

Why → Plays execute strictly in file order; order: sorted|reverse_sorted|shuffle only controls host order inside a play.

Interview tip → Put import_playbook at the top level only.

All Ansible questions Roadmap: Ansible

More on Rolling Updates, Delegation and Orchestration