YAML Style Guide

Use the repository’s yamllint configuration and preserve schema, ordering and intentional scalar types.

  • Indent with spaces, never tabs. Use two spaces per level unless the project specifies otherwise.
  • Use double-quoted strings in Ansible configuration. Leave actual booleans and numbers unquoted; quote strings resembling them.
  • Use the document start (—) where required. Respect the configured line limit, including 120 columns for Ansible collections.
  • Use block scalars deliberately. Check behavior before changing shell command folding or Jinja expressions.
  • Store secrets in approved secret storage, not plaintext configuration.
---
service_name: "example"
service_enabled: true
service_port: 8080

Run YAML lint and the consuming application’s schema or syntax check. Valid YAML alone does not guarantee a valid workflow, role or deployment.