Understanding file formats
By default, Salt uses YAML for its various files. There are two primary reasons for this:
YAML is easily converted into Python data structures
YAML is easy for humans to read and modify
Salt configuration files must be in YAML as well (or JSON, which can be read by YAML parsers), but other files such as states, pillars, reactors, and so on can use other formats. A data serialization format is the most common, but any format that can be translated into a Python dictionary will do just fine.
For example, there are three different Python renderers that ship with Salt: py
, pyobjects
, and pydsl
. Each has its strengths and weaknesses, but the end result is the same: they execute Python code that results in a dictionary, which is then passed into Salt.
Generally speaking, you will find two types of renderers inside of Salt. The first returns data in a Python data structure. Both serializers and code-based modules fit into this category. The second is for managing text formatting...