Changes

Jump to: navigation, search

Introduction to YAML

340 bytes added, 00:02, 25 November 2019
Some examples: file written in YAML
= Some examples: file written in YAML =
== YAML File and Python ==
File name: students.yaml
<pre>
students:
{'id_number': 112001987, 'name': 'Raymond', 'program': 'CNS'}]}
</pre>
The contents of students.yaml can be created by the following python code:
<pre>
#!/usr/bin/env python3
import yaml
students = {'students': [{'name': 'David', 'id_number': '012345678', 'program': 'CTY'},
{'name': 'Raymond', 'id_number': 112001987, 'program': 'CNS'}]}
 
print(yaml.dump(students))
</pre>
== Ansible playbooks ==
File Name: get_os_version.yaml
1,760
edits

Navigation menu