What is that YAML File which we use in most of the Cloud Automation Tools like in OpenStack Heat Templates? YAML is a data serialization format. As we can read it, it is human readable. We talked a huge about Cloud Automation via various articles – Relationship of Cloud Automation and Abstraction, Automation in the Cloud, not exactly we want to distract the readers from the current title, but just some references which a relatively new reader will find to be useful.
What is YAML File We Use in Cloud Automation
The basic idea is that, any data can be represented by a combination of lists, tables (hash) data and scalar via YAML. YAML describes these forms of data (YAML representations), and a syntax to present the data as a stream of characters (the YAML flow).
A computer application passes the YAML flow by loading the operation. The syntax of YAML stream is relatively simple and effective, less verbose as XML, less compact than the CSV and was established so that it is more readable by humans as possible, while being able to be matched easily with common types of data, in high-level languages. It borrows some notations from these languages.
Features and Examples of YAML File We Use in Cloud Automation
YAML offers both an indented and an “in-line” style for denoting associative arrays and lists. A major part of its accessibility comes from eschewing the use of enclosures such as quotation marks, brackets, braces, and open/close-tags, which can be hard for the human eye to balance in nested hierarchies. An example can be given here :
# see https://github.com/rackspace-orchestration-templates/wordpress-multi/blob/master/wordpress-web-server.yaml
# # Example starts
This is a Heat template to deploy a single Linux server running a WordPress.
# Server settings
description: WordPress Web Server Name
- allowed_pattern: "^[a-zA-Z][a-zA-Z0-9-]*$"
Must begin with a letter and contain only alphanumeric characters.
description: Server Image used for all servers.
default: Ubuntu 12.04 LTS (Precise Pangolin)
- Ubuntu 12.04 LTS (Precise Pangolin)
description: Must be a supported operating system.
description: Web Cloud Server flavor
default: 2 GB Performance
- 1 GB Performance
- 2 GB Performance
- 4 GB Performance
- 8 GB Performance
- 15 GB Performance
- 30 GB Performance
- 1GB Standard Instance
- 2GB Standard Instance
- 4GB Standard Instance
- 8GB Standard Instance
- 15GB Standard Instance
- 30GB Standard Instance
Must be a valid Rackspace Cloud Server flavor for the region you have
selected to deploy into.
# Official website : http://www.yaml.org/start.html
# spec : http://yaml.org/spec/1.2/spec.html
As we can see, it is easy to understand what function it does – its readable.