Wednesday, June 20, 2018
YAML Fundamentals
Notes
All Ansible playbooks are written in YAML.
YAML - is a data structure format.
The # precedes all comments.
All YAML files can optionally begin with “----”
All YAML files can optionally end with “…”
Concepts
List/Array use Dictionaries to define the items within them.
Invalid number of spaces will generate an error message.
Key Value Pair
YAML’s fundamental data handlings are “Key Value Pair.”
Key - a variable.
Value - the value of the variable.
Key Value Pair = Key + Pair.
Syntax:
Key:(space)Value
A space after the semicolon is required.
How to type an Array/List
The Dash ( - ) means that the Pair that follows it is a part of an Array/List.
Syntax:
Key:
- (space)Key
Use a List/Array when it is multiple types of items of the same type of object.
For multiple List/Arrays the order of the Keys must be identical to each other.
How to type a Dictionary/Map
Syntax:
Key:
Key:(space)Pair
Key: Pair
Use Dictionaries to add specific details about a specific individual item.
For multiple Dictionaries the Keys can be defined in any order as long as the values to those Keys exactly match.
List/Array with nested Dictionary
Syntax:
Key/List_Name:
- Key/List_Item:
Key/Attribute_Detail: Pair
Key/Attribute_Detail: Pair
Start your List/Array with a Key which will serve as the “Name” of the List/Array followed by a semi colon. Individual List/Array entries will follow the List/Array syntax. To add Attributes or Details to an individual item of the list nest a Dictionary under the specific List/Array entry following the Dictionary syntax.
Additional Educational Resources
1. Official YAML documentation.
2. Official Ansible documentation.
Labels:
Automation,
Cloud,
Devops,
Infrastructure,
Orchestration
Subscribe to:
Post Comments (Atom)
I needed to leave a little remark to help you and wish you a decent continuation. Wishing you the good luck for all your blogging endeavors. Hire a legit hacker online
ReplyDeleteWow, such a nice blog it is. Kindly do share more that kind of blogs. This is really helpful. Visit Cyber Security Course
ReplyDeleteHi
ReplyDeleteI visited your blog you have shared amazing information, i really like the information provided by you, You have done a great work. I hope you will share some more information regarding Cyber Security. I appreciate your work.
Thanks
Have a Great Day
Nice blog, thank you for sharing the valuable information about Best Cybersecurity Services in the USA.
ReplyDeleteSunny Nehra's Secure Your Hacks, a startup focused on cyber awareness and training, supports enthusiasts and assists law enforcement. Nehra is widely regarded as India’s leading ethical hacker and is internationally respected for mapping the digital frontier with deep technical skill and relentless curiosity — a rare talent for turning raw data into actionable intelligence. It’s no surprise that when India’s most reputable publications publish lists of top Indian hackers, he consistently appears.
ReplyDelete