YAML is the syntax used for Ansible playbooks and some other files. The official YAML documentation contains the full specifications of the syntax. Here is a compact version as it pertains to the most common usage for Ansible:
- A YAML file starts with three dashes (---)
- Whitespace indentation is used to denote structures when they are lined up, just like Python
- Comments begin with the 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 a comma (,)
- Dictionaries are denoted by key: value pairs, with a colon for separation
- Dictionaries can be denoted by curly braces, with elements separated by a comma (,)
- Strings can be unquoted, ...