🚀 Week 6 of my DevOps Journey : Mastering Variables, JSON & YAML


Mastering Variables, JSON & YAML
This week, I focused on the building blocks of configuration and automation in DevOps: variables, JSON, and YAML. These are essential for writing reusable, flexible, and structured code in modern Infrastructure as Code tools like Ansible, Terraform, Kubernetes, and CI/CD pipelines.
🔍 What I Learned:
📌 Variables in DevOps Scripts
Used variables in Bash scripts and
Vagrantfile
to make VM provisioning more dynamic.Learned about environment variables (
export VAR=value
), default values, and scope (global vs local).
📄 JSON (JavaScript Object Notation)
Understood its role in config files, REST APIs, and cloud resource provisioning.
Practiced working with nested structures and arrays.
Learned to format, validate, and parse JSON for better readability.
🧾 YAML (YAML Ain’t Markup Language)
Explored YAML’s clean, readable syntax used in Docker Compose, GitHub Actions, Kubernetes, and Ansible.
Learned best practices like using spaces over tabs, document separation (
---
), and correct indentation.Compared YAML vs JSON for real-world config management.
📚 Resources That Helped:
📘 Learn YAML in Y Minutes: https://learnxinyminutes.com/docs/yaml
📘 JSON vs YAML – What’s the Difference?: https://www.json2yaml.com
📺 JSON & YAML Crash Course (YouTube): https://www.youtube.com/watch?v=cdLNKUoMc6c
📘 DevOps Variable Guide by Educative: https://www.educative.io/blog/devops-variables
✅ JSON Formatter & Validator: https://jsonlint.com
🛠️ Key Tasks I Completed:
✅ Declared and used variables in Vagrant and shell scripts.
✅ Created and validated multi-layered JSON files for configurations.
✅ Wrote YAML files for simulated Kubernetes pods and CI/CD pipelines.
✅ Converted JSON ↔ YAML for better readability and compatibility.
✅ Identified and fixed common errors like wrong indentation and syntax.
⚠️ Common Errors & Quick Fixes:
❌ Error | 💡 Solution |
bad indentation in YAML | Use only spaces, no tabs. Tools like YAML Lint help. |
unexpected end of JSON input | Use JSONLint to find missing commas/brackets. |
Variable not found | Ensure it’s exported (export VAR=value ) and accessed correctly ($VAR ) |
YAML list parsing issues | Use - consistently and maintain indentation levels. |
🎯 My Takeaway:
Variables, JSON, and YAML may seem basic — but they’re the language of automation. From Vagrant to Kubernetes, understanding these formats helps you control, scale, and debug infrastructure with precision.
Let’s connect if you’re learning YAML, writing automation configs, or exploring Infrastructure as Code!
#DevOps #Git #Vagrant #LinuxServers #InfrastructureAsCode #VersionControl #SSH #Virtualization #Automation #SystemAdministration
Subscribe to my newsletter
Read articles from Mritunjay Tiwari directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
