A playbook is the YAML file you run, and it holds one or more plays in order. A play maps a group of hosts to the tasks that run on them, and sets how those tasks run. A task is one unit of work that calls a single Ansible module, such as yum or service.
A play's hosts line picks machines from the inventory, and play keywords such as become or vars apply to every task in it. A playbook with two plays can set up the web servers first and the databases second.
By default, Ansible runs each task on every host in the play before it starts the next task.
# Playbook
- name: Web server setup # Play 1
hosts: webservers
tasks:
- name: Install Apache # Task 1
yum:
name: httpd
state: present
- name: Start Apache # Task 2
service:
name: httpd
state: started
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.