The YAML rules that bite, the play as the unit that binds hosts to tasks, and the flags you run a playbook with daily. Handlers that bounce a service only when its config moved, privilege escalation with become, and the fixed lifecycle every run follows — built around the real Larkspur web and database stack.
7 topics
A playbook is where Ansible stops being a one-off command and becomes a checked-in description of a whole system. This chapter writes a real one: site.yml, which installs and configures nginx and gunicorn on the Larkspur web tier and PostgreSQL 16 on db1.larkspur.io, with handlers that reload services only when a config file actually changes. Everything you reach for daily lives in these seven pages.
The order is deliberate. YAML first, because every playbook is YAML and its quirks masquerade as Ansible bugs. Then the play — the unit that binds hosts to tasks — how you run it, how tasks invoke modules, the two identity topics that have no analog in a provisioning tool (handlers and become), and finally the fixed lifecycle every run follows from fact gathering to handlers at the end.