Automation · Data Formats › YAML
Mappings
Cheat sheet · https://pcornel.dk/topic.php?topic=5825
Answer
YAML mappings are key-value pairs written key: value, nested by indentation with spaces, never tabs. They correspond to JSON objects and Python dictionaries.
Remember
- Mappings are key: value pairs.
- Nesting uses indentation with spaces.
- Duplicate keys are errors or silently overwrite.
First checks
yq 'keys' file.yaml— mapping keysyamllint -d '{rules: {key-duplicates: enable}}' file.yaml— duplicate keys- Indentation consistency — structure
Verify in this order
key: value → mapping
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5825