YAML

YAML or YML (it has too many meanings: Yet Another Markup Language; Yaml Ain’t Markup Language) who cares?

It’s easy to read!

Example YAML
 1 ---
 2 - hosts: <individual host> or [group of hosts]
 3   gather_facts: false
 4
 5
 6   vars_files:
 7
 8   tasks:
 9
10
11   - name: task name 1
12     module:
13       module_command:
14
15   - name: task name 2
16     module:
17       module_command:

The three --- dashes indicate the start of a YML file. Then comes the playbook definitions based on indention’s much like that of Python.

Please look at Figure 3 below to take note of how everything lines up.

../_images/indent.png

Fig 3

We declare what hosts we want to work with or group of hosts based on a inventory file, we can also make an external variable sheet to reference to run our play against. Example, we want to declare how a vlan, a route or a virtual server are built and only allow individuals to pass variables to the play standardizing how we build.

Next comes the tasks, these are the individual plays to be run from our playbook.