What is Yaml ?

What is YAML?   YAML is a data serialization language that is often used for writing configuration files. Depending on whom you ask, YAML st...

What is YAML?


 YAML is a data serialization language that is often used for writing configuration files. Depending on whom you ask, YAML stands for yet another markup language or YAML ain’t markup language (a recursive acronym), which emphasizes that YAML is for data, not documents. 

YAML is a popular programming language because it is human-readable and easy to understand. It can also be used in conjunction with other programming languages.

YAML has features that come from Perl, C, XML, HTML, and other programming languages. YAML is also a superset of JSON, so JSON files are valid in YAML.

YAML uses Python-style indentation to indicate nesting. Tab characters are not allowed, so whitespaces are used instead. There are no usual format symbols, such as braces, square brackets, closing tags, or quotation marks. YAML files use a .yml or .yaml extension. 

The structure of a YAML file is a map or a list.

Maps allow you to associate key-value pairs. Each key must be unique, and the order doesn't matter. Think of a Python dictionary or a variable assignment in a Bash script.

A map in YAML needs to be resolved before it can be closed, and a new map is created. A new map can be created by either increasing the indentation level or by resolving the previous map and starting an adjacent map. 

A list includes values listed in a specific order and may contain any number of items needed. A list sequence starts with a dash (-) and a space, while indentation separates it from the parent. You can think of a sequence as a Python list or an array in Bash or Perl. A list can be embedded into a map. 

YAML also contains scalars, which are arbitrary data (encoded in Unicode) that can be used as values such as strings, integers, dates, numbers, or booleans.

When creating a YAML file, you’ll need to ensure that you follow these syntax rules and that your file is valid. A linter is an application that verifies the syntax of a file. The yamllint command can help to ensure you’ve created a valid YAML file before you hand it over to an application.

Here's an example of a simple YAML file for an employee record that demonstrates the syntax rules.

---
# An employee record
name: Martin D'vloper
job: Developer
skill: Elite
employed: True
foods:
  - Apple
  - Orange
  - Strawberry
  - Mango
languages:
  perl: Elite
  python: Elite
  pascal: Lame
education: |
  4 GCSEs
  3 A-Levels
  BSc in the Internet of Things

One of the most common uses for YAML is to create configuration files. It's recommended that configuration files be written in YAML rather than JSON, even though they can be used interchangeably in most cases, because YAML has better readability and is more user-friendly.  

YAML is also used by the automation tool Ansible to create automation processes, and for Kubernetes resources and deployments. 

A benefit of using YAML is that YAML files can be added to source control, such as Github, so that changes can be tracked and audited. 

YAML in Ansible

Ansible Playbooks are used to orchestrate IT processes. A playbook is a YAML file containing 1 or more plays, and is used to define the desired state of a system. 

Each play can run one or more tasks, and each task invokes an Ansible module. Modules are used to accomplish automation tasks in Ansible. Ansible modules can be written in any language that can return JSON, such as Ruby, Python, or bash.

An Ansible Playbook consists of maps and lists. To create a playbook, start a YAML list that names the play, and then lists tasks in a sequence. Remember that indentation is not an indication of logical inheritance. Think of each line as a YAML data type (a list or a map).

By using YAML templates, Ansible users can program repetitive tasks to happen automatically without having to learn an advanced programming language.

YAML for Kubernetes

Kubernetes works based on defined state and actual state. Kubernetes objects represent the state of a cluster and tell Kubernetes what you want the workload to look like. Kubernetes resources, such as pods, objects, and deployments can be created using YAML files. 

When creating a Kubernetes object, you’ll need to include specifications to define the object's desired state. The Kubernetes API can be used to create the object. The request to the API will include the object specifications in JSON, but most often you’ll provide the required information to kubectl as a YAML file. Kubectl will convert the file into YAML for you when it makes the API request.

Once an object has been created and defined, Kubernetes works to make sure that the object always exists. 

Developers or sysadmins specify the defined state using the YAML or JSON files they submit to the Kubernetes API. Kubernetes uses a controller to analyze the difference between the new defined state and the actual state in the cluster.


Red Hat Ansible Automation Platform’s human-readable YAML automation language makes it possible for users across an organization to share, vet, and manage automation content.

Ansible Automation Platform includes all the tools needed to implement enterprise-wide automation, including playbooks and analytics. It allows users to centralize and control their IT infrastructure with a visual dashboard, role-based access control, and more to reduce operational complexity.

Red Hat OpenShift is Kubernetes for the enterprise. It includes all of the extra pieces of technology that make Kubernetes powerful and viable for the enterprise, including registry, networking, telemetry, security, automation, and services.

With Red Hat OpenShift, developers can make new containerized apps, host them, and deploy them in the cloud with the scalability, control, and orchestration that can turn a good idea into new business quickly and easily.

COMMENTS

Name

[ Download ] Bhuj The Pride of India Full Movie 480p & 720p,1,[DOWNLOAD] Heropanti 2 Movie Download Free in Hindi 720p 1080p,1,10 Steps To Become A Hacker (An Ethical Hacker),1,1080P,1,Allen biology module,1,Allen chemistry module,1,Allen physics module,1,Bhool Bhulaiyaa 2 Download in Hindi– 720P,1,Download [KGF-2 South Blockbuster Movie in Hindi Dubbed] Free,1,Download Tere Bin Laden (2010) 480p | 720p HD,1,Download[RRR-2022] south blockbuster movie download in hindi dubbed in hd,1,Free Ethical Hacking Course for Beginners,1,Heropanti 2 Songs Download,1,How QR Codes Work and What Makes Them Dangerous—a Computer Scientist Explains,1,How to do Carding,1,How To Hack/Unlock Android Pattern,1,Instagram King Mod,1,Instagram Mod apk,1,Instagram MOD APK 234.0.0.19.113 (Instathunder),1,Introducing Windows 11,1,Is Warp Drive real?,1,PW app apk,1,Samrat Prithviraj Movie Download Downloadhub 480p|,1,Wifi Hacking,1,
ltr
item
CyberPedia: What is Yaml ?
What is Yaml ?
CyberPedia
https://gofindly.blogspot.com/2021/07/what-is-yaml.html
https://gofindly.blogspot.com/
https://gofindly.blogspot.com/
https://gofindly.blogspot.com/2021/07/what-is-yaml.html
true
8718369367284999788
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content