Introduction
YAML is a digestible data serialisation language widely used to build configuration files with any computer language.

Designed for human interaction, YAML is a tight superset of JSON, another data serialisation language. But because it is a rigorous superset, it is able to do all of JSON's capabilities and more. One significant distinction between JSON and YAML is that JSON employs brackets and braces, whereas YAML truly understands what newlines and indentation represent.
Defining YAML
There are only three straightforward guidelines to keep in mind when producing YAML for SLS files, despite the syntax initially appearing intimidating and terse.

Rule One: Indentation
Relationships between data layers are represented in YAML using a fixed indentation style. Each level's indentation must include precisely two spaces, according to Salt. Avoid using tabs.
Rule Two: Colons
Dictionary objects in Python are just key-value pairs. Users of other languages may recognize this data type as hashes or associative arrays.
In YAML, dictionary keys are represented as strings with a following colon at the end. Following the colon and separated by a space, values are represented by either a string or a number:
myKey: myValue
In Python, the above maps to:
{"myKey": "myValue"}
An indentation can be used as an alternative to correlate a value with a key.
myKey:
myValue
Note: Although the syntax above is acceptable for YAML, it is uncommon in SLS files since, most frequently, the value for a key is a list of values rather than a unique value.
In Python, the above maps to
{"myKey": "myValue"}
Dictionaries can be nested:
first_level_key:
second_level_key: value_of_second_level_key
And in python
{"first_level_key": {"second_level_key": "value_in_second_level_key"}}
Rule Three: Dashes
Using a single dash and a space, lists of items are represented. Due to their having the same level of indentation, multiple items are included in the same list.
- listValueOne
- listValueTwo
- listValueThree
A key-value pair's value may be a list. In Salt, this is quite typical:
my_dictionary:
- listValueOne
- listValueTwo
- listValueThree
In Python, the above maps to
{"my_dictionary": ["listValueOne", "listValueTwo", "listValueThree"]}



