What is an Ansible Playbook?
⚡
Quick Answer
A playbook is a YAML file that describes automation as an ordered set of plays and tasks, mapping groups of hosts to the modules and desired state that should be applied to them.
Detailed Answer
Playbooks are Ansible unit of orchestration: each play targets an inventory group and runs tasks (module calls) that are idempotent, so re-running converges to the same state. Variables, handlers (run on change), templates, and roles make playbooks reusable and environment-aware.
💡
Interview Tip
Mention idempotency and roles — that you can re-run a playbook safely and structure it for reuse.
ansibleplaybookyaml