What is an Ansible Playbook
From bib. source
[…], Ansible uses a metaphor to describe its configuration files. They are called ‘playbooks’, and they list sets of tasks (‘plays’ in Ansible parlance) that will be run against a particular server or set of servers. […] In Ansible, you write playbooks (a list of instructions describing the steps to bring your server to a certain configuration state) that are then played[sic] on your servers.
In sum, Ansible uses the metaphor of a playbook–a written document that plans out a particular performance, instructing the various actors or agents in it to express certain things (Geerling 2023, 47). Playbooks in Ansible refer to files that contain a description of the end-state (refer to 20250309104008-What_is_Idempotency) for a server or set of servers for which that playbook is applied (Ibid). The application of a playbook is a play (Ibid).
While they contain a description of the desired end-state, this description is made in terms of tasks, which are discrete, separate end-states for different parts of an expected system (such as the server or servers to which the playbook will be applied). (Because this is what tasks refer to in Ansible, Ansible commands themselves are called jobs.)
playbook play lists configuration_management configuration_file set task job metaphors
bibliography
- “Ansible Playbooks.” In Ansible for DevOps: Server and Configuration Management for Humans, 2nd ed., 47-83. Leanpub, 2023.