Difference between revisions of "Introduction to YAML"

From CDOT Wiki
Jump to: navigation, search
Line 17: Line 17:
 
::: name: 'Name B'
 
::: name: 'Name B'
 
::: id: '98765432'
 
::: id: '98765432'
 +
= Some examples: file written in YAML =
 +
== Ansible playbooks ==
 +
<pre>
 +
students: 
 +
  - name: David   
 +
    id_number: 012345678   
 +
    program: CTY 
 +
  - name: Raymond
 +
    id_number: 112001987
 +
    program: CNS
 +
</pre>

Revision as of 20:10, 22 November 2019

What is YAML?

  • YAML stands for "YAML Ain’t markup language"
  • It is a human-readable data serialization language that is used in Ansible to package output and its playbooks

What are the major components in YAML?

  • declarations: name: 'yum'
  • lists:
- 'item_a'
- 'item_b'
- 'item_c'
  • associative arrays:
item_a:
name: 'Name A'
id: '12345678'
item_b:
name: 'Name B'
id: '98765432'

Some examples: file written in YAML

Ansible playbooks

students:   
  - name: David     
    id_number: 012345678     
    program: CTY   
  - name: Raymond
    id_number: 112001987
    program: CNS