Posts

Ansible Custom Inventory – How I Organize and Manage My Servers

 While working with Ansible, one of the most essential things I learned was how to create and manage a custom inventory . The inventory is basically the place where I list all my servers — and tell Ansible how to connect to them. Once I understood this clearly, working with multiple EC2 instances became much easier. In this blog, I’ll explain the concept of custom inventory the way I understood it and show the formats I used in my hands-on practice. ⭐ What Is an Inventory? (My Understanding) An inventory is a file where I define the servers (managed nodes) that Ansible should control. It contains: server names IP addresses SSH usernames private key file paths group names For me, the inventory acts like: “A phonebook for Ansible — it tells Ansible which server to call and how to connect.” ⭐ Types of Inventories I Used Ansible supports different inventory formats, but these are the two I practiced: 1️⃣ Static Inventory (INI Format) This is the simple...

Ansible Playbooks – How I Learned to Automate Complete Tasks

 After getting comfortable with ad-hoc commands, I moved on to the most important part of Ansible — Playbooks . This is where the real automation happens. Ad-hoc commands are good for quick tasks, but playbooks allow me to write repeatable, structured, and complete automation scripts . In this blog, I’ll explain playbooks in the simplest way possible, based on how I understood and practiced them. ⭐ What Are Ansible Playbooks? (In My Own Words) Playbooks are YAML files where I define: what tasks I want to run on which servers in what order with what configurations Playbooks allow me to automate full workflows like: installing packages configuring services deploying applications managing files creating users restarting services For me, a playbook is basically: “A step-by-step automation recipe written in YAML.” ⭐ Basic Structure of a Playbook Here’s the structure I internalised: - name: <description> hosts: <target_serv...

Ansible Ad-Hoc Commands – Quick & Powerful Automation

 Once I finished setting up Ansible and connecting it to my EC2 instances, the very next thing I learned was how to use Ad-Hoc commands . These became extremely useful for me because they allow automation without writing a playbook . I could test connectivity, install packages, create files, check uptime, and much more in just a single line. In this blog, I’ll share what ad-hoc commands are, how I understood them, and the exact commands I practiced. ⭐ What Are Ad-Hoc Commands? (In My Perspective) Ad-Hoc commands are one-time Ansible commands that I run directly from the terminal. They are perfect for quick tasks like: checking if servers are reachable installing or removing packages starting or stopping services copying files running shell commands gathering system details These commands helped me understand Ansible modules faster before writing full playbooks. ⭐ Basic Syntax I Use ansible < host / group > - m < module > - a "<argum...

Ansible Installation & EC2 Setup – My Practical Experience

  After understanding Ansible modules and the overall architecture, the next thing I wanted to do was actually install Ansible and set up a working environment . This is the part where theory meets hands-on practice — and honestly, this is where everything started making sense for me. In this blog, I’ll share how I installed Ansible on a Linux EC2 instance and connected it with other EC2 servers to run automation. ⭐ Where I Installed Ansible I installed Ansible on a Linux-based EC2 instance , which acted as my control node . You can use: Amazon Linux 2 Ubuntu CentOS All work fine. I mostly used Amazon Linux 2 and Ubuntu in my practice. 🔧 Installing Ansible on Amazon Linux 2 These are the exact steps I followed: 1️⃣ Update the system sudo yum update - y 2️⃣ Install Ansible using Amazon Extras sudo amazon-linux-extras install ansible2 -y 3️⃣ Verify installation ansible --version Once I saw the version output, I knew Ansible was installed successfull...

Understanding Ansible Modules

 As I continued learning Ansible, one of the most important concepts I came across was Modules . They are the core of how Ansible performs automation. Once I understood modules clearly, writing playbooks and running ad-hoc commands became much easier and more meaningful. In this blog, I’m sharing what Ansible modules are and how I understood them through hands-on practice. ⭐ What Are Ansible Modules? (In My Own Words) Modules are the actual actions Ansible performs on a server. If I want to: install a package create a file add a user start a service copy a configuration Ansible uses a module to do it. So for me: “Modules are the building blocks of every automation task in Ansible.” Every ad-hoc command and every task inside a playbook uses a module. ⭐ How I Understand the Working of Modules Whenever I run Ansible: Ansible connects to the server through SSH The selected module runs on the remote machine It performs the action I defined I...

Ansible Architecture

  When I started learning Ansible, one of the first things I wanted to understand was how it actually works internally . My trainer explained the architecture in a simple way, and once I understood the flow, everything else in Ansible became easier. In this blog, I’m sharing Ansible Architecture exactly how I understood it during my DevOps training. ⭐ How I Understand Ansible Architecture Ansible’s architecture is simple and lightweight. There are mainly three major components : Control Node (Controller) Managed Nodes (Target Machines) Inventory File Ansible uses SSH to connect to servers — no agents, no background services, no complicated setup. ⭐ 1. Control Node (Where Ansible Runs) This is the machine where Ansible is installed. From here, I run: ad-hoc commands playbooks inventory operations automation tasks During my practice, I used an Ubuntu EC2 instance as the controller. The controller is the “brain” of Ansible. ⭐ 2. Managed Nodes ...

“What is Ansible? – My Understanding as a DevOps Learner”

  What is Ansible? – My Understanding as a DevOps Learner When I started my DevOps journey, Ansible was one of the first automation tools I learned. At the beginning, I only knew that Ansible “automates tasks,” but after going through my training sessions and hands-on practice, I understood how powerful and simple it actually is. In this blog, I want to explain what Ansible means in my own words , exactly how I understood it as a beginner. ⭐ How I Understand Ansible Ansible is an open-source automation tool that helps us manage servers without doing everything manually. Instead of logging into each machine and running commands one by one, I can write instructions in a simple YAML file, and Ansible applies them to any number of servers at the same time. So for me, Ansible is basically: “Write once → run anywhere → automate everything.” That’s the beauty of it. ⭐ Why Ansible is Very Useful From my learning, these are the main reasons: 1. It is agentless This was the ...