1,760
edits
Changes
→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