Interview Prep/Ansible/Playbook Design, Handlers and Idempotency

Your playbook has 80 tasks and a failure at task 63. You fixed the cause. How do you resume efficiently?

IntermediateScenarioPlaybook Design, Handlers and Idempotency
Answer

Situation read → Avoid re-running everything.

What I'd do →

ansible-playbook site.yml --start-at-task "Deploy application"
ansible-playbook site.yml --limit @site.retry   # retry file if enabled

If the playbook is idempotent, re-running the whole thing is also safe.

Why → --start-at-task skips earlier tasks (and their registered vars), so use it only when later tasks do not depend on skipped ones.

Interview tip → Retry files are disabled by default; use --limit with failed hosts from the recap.

All Ansible questions Roadmap: Ansible

More on Playbook Design, Handlers and Idempotency