A handler restarts a service but the restart takes 30 seconds and later tasks fail on connection refused.
IntermediateScenarioRolling Updates, Delegation and Orchestration
Answer
Situation read → Race after restart.
What I'd do → Flush handlers, then wait for readiness.
- ansible.builtin.meta: flush_handlers
- ansible.builtin.wait_for: { port: 5432, timeout: 120 }
Why → Handlers normally run at the end of the section, so you must flush before dependent tasks.
Interview tip → Use health-check endpoints rather than only port checks.
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