YAML file formatting

There're a few rules to follow while developing YAML files. YAML uses indentation (like Python), which builds the relationship of items with one another:

  1. So, the first rule when writing a YAML file is to make your indentation consistent, using either whitespace or tabs, and don't mix them.
  2. The second rule is to use a colon : when creating a dictionary with a key and value (sometimes they're called associative arrays in yaml). The item to the left of the colon is the key, while the item to the right of the colon is the value.
  3. The third rule is to use dashes "-" when grouping items inside a list. You can mix dictionaries and lists inside the YAML file in order to effectively describe your data. The left-hand side serves ...

Get Hands-On Enterprise Automation with Python. now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.