Skip to main content
Kill -9 Club
Sign in

playbook

Automation

A YAML file describing the state one or more machines should be in: which hosts, then a list of tasks, each calling one module with the state it must establish, and optionally handlers that run when a task changed something. It is read as a claim, not as a script: "nginx is installed", not "install nginx". The difference shows on the second run, when a script repeats every action and a playbook reports changed=0 because every module found its state already true. The misconception is that a playbook is a fleet tool: it earns its place on one machine, as documentation that cannot drift from the server because the server is built from it. ansible-playbook site.yml --check --diff shows what a run would change without changing anything. Written for a single run, it is a script with more files.

Also written: play, site.yml

playbook — definition | Kill -9 Club