ansible Playbook's structure


Example

The format of a playbook is quite straightforward, but strict in terms of spacing and layout. A playbook consists of plays. A play is a combination of targets hosts and the tasks we want to apply on these hosts, so a drawing of a playbook is this:

Pictorial representation of an Ansible playbook

To execute this playbook, we simply run:

ansible-playbook -i hosts my_playbook.yml