YAML Files
Ansible uses YAML syntax to compute the tasks. YAML is a data serialization language
is can be easily read and understood by any person. The syntax and format of a YAML
file is as follows:
1. Each file begins with three hyphens (---)
2. Declaring a variable has the syntax var_name:var_result
ex:
answer: 42
3. Boolean values are Yes/No
4. A list item begins with a hyphen followed by a space then the name. Below is a
list of animals
ex:
- Cats
- Dogs
5. Associative arrays begin with a hyphen followed by a space then
var_name:var_result
ex:
- Cats:Persian
- Dogs:Pugs
6. You can combine associative arrays and lists to make a data structure
ex:
--- #Pets
Cats:
- name: Persian
life_span: 14.1
- name: Burmese
life_span: 15
Dogs:
- name: Pug
life_span: 11
- name: Corgi
life_span: 15