2 spaces
- string
- number
- boolean
- list
- map
host: ger-43
datacenter:
location: Germany
cab: "13"
cab_unit: 3
# block-style
list_of_strings:
- one
- two
- three
# flow-style
another_list_of_strings: [one,two,three]
# block-style
map_example:
- element_1: one
- element_2: two
# flow-style
map_example2: {element_1: one , element_2: two }
more comples example - list of maps
credentials:
- name: 'user1'
password: 'pass1'
- name: 'user2'
password: 'pass2'
# this is comment in yaml
user_name: cherkavi # comment after the value
user_password: "my#secret#password"
- one line string ( removing new line marker )
comments: >
Attention, high I/O
since 2019-10-01.
Fix in progress.
- each line of text - with new line marker ( new line preserving )
downtime_sch: |
2019-10-05 - kernel upgrade
2019-02-02 - security fix
---
name: first document
---
name: second document
# not necessary marker ...
...
---
name: third document
place of metadata, header
# this is metadata storage place
---
name: first document
& - anchor
-
- reference to anchor simple reference
---
host: my_host_01
description: &AUTO_GENERATE standard host without specific roles
---
host: my_host_02
description: *AUTO_GENERATE
reference to map
users:
- name: a1 &user_a1 # define anchor "user_a1"
manager:
- name: a2
manager: *user_a1 # reference to anchor "user_a1"
example with collection
---
host: my_host_01
roles: &special_roles
- ssh_server
- apache_server
---
host: my_host_02
roles: *special_roles
another yaml example, anchor reference
base: &base
name: Everyone has same name
foo: &foo
<<: *base
age: 10
bar: &bar
<<: *base
age: 20
- seq
- map
- str
- int
- float
- null
- binary
- omap ( Ordered map )
- set ( unordered set )
name: Vitalii
id_1: 475123 !!str
id_2: !!str 475123
should be defined inside metadata
%TAG ! tag:hostdata:de_muc
---
# reference id is: DE_MUC
location: !DE_MUC Cosimabad