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.
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