Interview Prep/Ansible/Rolling Updates, Delegation and Orchestration

After a deployment you want to run smoke tests from the controller against each host.

BeginnerScenarioRolling Updates, Delegation and Orchestration
Answer

Situation read → Post-deploy verification.

What I'd do →

- ansible.builtin.uri:
    url: "https://{{ inventory_hostname }}/health"
    validate_certs: true
    status_code: 200
  delegate_to: localhost

Why → The controller tests the same path users take; failures stop the batch.

Interview tip → Fail the play on a failed smoke test to prevent promoting a broken release.

All Ansible questions Roadmap: Ansible

More on Rolling Updates, Delegation and Orchestration