YAML
- YAML is a data representation format.
- Refer Here for yaml syntax from ansible
- YAML use name value pair as a representational format.
<name>: <value>
- Values come in many forms
- number
- text
- boolean
- list/array
- map/object
- number
year: 2025
price: 10.5
day: tuesday
day: 'tuesday'
day: "tuesday"
price: '10.5'
holiday: False
holiday: No
workingday: True
workingday: Yes
remainingdays: ['tue', 'wed', 'thu', 'fri']
remainingdays:
- tue
- wed
- thu
- fri
remainingdays:
- tue
- wed
- thu
- fri
address:
flat: 601A
building: Nilgiri
city: Hyderabad
landmark: 500030
include_newlines: |
exactly as you see
will appear these three
lines of poetry
fold_newlines: >
this is really a
single line of text
despite appearances
Example
---
movies:
- name: Superman
release: 2025
category: Action/Sci-fi
duration: 130
summary: from dc
director: James Gunn
actors:
- David Corenswet
- Rachel Brosnahan
- name: 'The Fantastic Four: First Steps'
release: 2025
category: Action/Sci-fi
duration: 115
summary: from marvel
director: Matt Shakman
actors:
- Pedro Pascal
- Vanessa Kirby
- Try to write a yaml about your laptop
---
model: dell lattitue
manufacturer: dell
specifications:
cpu: intel i7 12 Gen
ram: 64GB
disk: 500 GB SSD
features:
boot:
- TPM
- UEFI
others:
- fingerprint
- faceid
- Try writing a yaml file describing your bike/car