# Ansible Playbook

In 
Published 2022-12-03

This tutorial explains to you how to create a simple Ansible playbooks and how to run it.

One time Ansible inventory is done, you can define what tasks can be done on the target machines. This definition is kept in a YAML file. In fact, you can have more YAML files with various tasks to be run on the targets. This YAML file is named an Ansible playbook.

Here it is an example of Ansible Playbook:

As you can see:

  • Ansible Playbook contains YAML lists and dictionaries
  • in a dictionary, the order is not important
  • in a list, the order is important

For running the Playbook you have to use the command ansible-playbook (see the image below).

where:

  • playbook.yml is the YAML file which contains the tasks
  • inventory.txt is Ansible inventory

That's simple !