YAML(Yet Ain’t Markup Language) Basics

YAML(Yet Ain’t Markup Language) Basics

• For Ansible, nearly every YAML file starts with a list
• Each item in the list is a list of key/value pairs, commonly called a “dictionary”
• All YAML files have to begin with “—” and end with “…
• All members of a list lines must begin with same indentation level starting with “- “

--- # A list of tasty fruits
fruits:
- Apple
- Orange
- Strawberry
- Mango
...

• A dictionary is represented in a simple key: value form (the colon must be followed by a space)

--- # An employee record
Employee:
name: Mohammad
job: DevOps Engineer
skill: Elite

Leave a Reply

Your email address will not be published. Required fields are marked *