YAML is the syntax used for Ansible playbooks and other files. The official YAML documentation contains the full specifications of syntax. Here is a compact version as it pertains to the most common usage for Ansible:
- YAML file starts with three dashes (---)
- Whitespace indentation is used to denote structure when they are lined up, just like Python
- Comments begin with hash (#) sign
- List members are denoted by a leading hyphen (-) with one member per line
- Lists can also be denoted via square brackets ([]) with elements separated by comma (,)
- Dictionaries are denoted by key:value pair with colon for separation
- Dictionaries can denoted by curly braces with elements separated by comma (,)
- Strings can be unquoted, but can also be enclosed ...