Automation
Data Formats
Cheat sheet · https://pcornel.dk/topic.php?topic=5817
Answer
Data formats such as JSON, YAML, XML and CSV are how automation tools exchange structured data — API payloads, inventories, playbooks, reports — so parsing and validating them correctly is essential.
Remember
- Use real parsers, never string splitting.
- Validate structure before using the data.
- YAML type guessing causes surprises.
First checks
jq . file.json— JSON validyamllint file.yaml— YAML lintxmllint --noout file.xml— XML well-formed
Verify in this order
data → parser → validation → automation
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=5817