YAML Basic with Python runner and yq

Опубликовано: 15 Май 2026
на канале: Ansible Sikho
14
1

🔹 YAML Basics with Python | Validate YAML using Python & yq

In this video, you’ll learn YAML fundamentals and how to validate YAML files using Python and yq. This session is perfect for beginners learning DevOps, Ansible, Kubernetes, or Automation.

📘 What is YAML?
YAML is:
✅ A data format (not a programming language)
❌ Not executable on its own
📄 Used for configuration files (Ansible, Kubernetes, CI/CD)
🐍 Parsed and validated using programs like Python
👉 YAML does not run by itself — it must be parsed by a program like Python

🎯 What you will learn in this video:
✔ What is YAML and where it is used
✔ Difference between data format vs executable code
✔ How to write a YAML (.yml) file
✔ How to validate YAML using Python (pyyaml)
✔ How to validate YAML using yq command-line tool
✔ Real-world DevOps validation workflow

🛠 Tools & Steps Covered
🔹 Step 1: Write YAML file

Create a .yml file with valid YAML syntax, Parse it through Python code and YQ

==================================

Install pyyaml using pip

pip install pyyaml

Step1 -- Write YML
Step2 -- need python runner
Step3 -- install yq
Step4 -- run yq command

For yq installation run below command ######

sudo dnf -y install https://extras.getpagespeed.com/relea...
OR
Step3 -- install yq

sudo wget https://github.com/mikefarah/yq/relea... -O /usr/local/bin/yq
sudo chmod +x /usr/local/bin/yq

Step 5: Check version:
yq --version



#yaml #yml #devops #ansible #pyto