YAML
As mentioned earlier, YAML (Yet Another Markup Language) is a human-readable programming language. YAML syntax is used to express the Ansible playbooks.
Here are some basic concepts of YAML.
- Key/Value pair:
Dictionary is represented in key/value pairs.
- Example:
james: name: james john rollNo: 34 div: B sex: male
- Representing lists:
Each element in a list has to be written in a new line with ‘-‘ as a prefix.
- Example:
countries: - America - China - Canada - Iceland
- Lists inside a dictionary:
We can have lists inside a dictionary.
- Example
james: name: james john rollNo: 34 div: B sex: male likes: - maths - physics - english
No comments:
Post a Comment