<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anushree GM</title>
    <description>The latest articles on DEV Community by Anushree GM (@anushree_gm).</description>
    <link>https://dev.to/anushree_gm</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3668244%2F0877869b-f45a-41d6-8ec6-37411a6f43ea.png</url>
      <title>DEV Community: Anushree GM</title>
      <link>https://dev.to/anushree_gm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anushree_gm"/>
    <language>en</language>
    <item>
      <title>Kubernetes Made Simple: How It Works Using Real-World Analogies</title>
      <dc:creator>Anushree GM</dc:creator>
      <pubDate>Tue, 17 Feb 2026 16:16:25 +0000</pubDate>
      <link>https://dev.to/anushree_gm/kubernetes-made-simple-how-it-works-using-real-world-analogies-38km</link>
      <guid>https://dev.to/anushree_gm/kubernetes-made-simple-how-it-works-using-real-world-analogies-38km</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Kuberenetes?&lt;/strong&gt;&lt;br&gt;
Kubernetes (often called K8s) is a system for automatically managing applications running in containers.&lt;/p&gt;

&lt;p&gt;Let’s understand this using a simple real-world analogy.&lt;/p&gt;

&lt;p&gt;Imagine you run a large restaurant chain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have many kitchens (servers).&lt;/li&gt;
&lt;li&gt;Each kitchen must prepare many dishes (applications).&lt;/li&gt;
&lt;li&gt;You want orders to be cooked reliably, even if a cook gets sick (failure).&lt;/li&gt;
&lt;li&gt;You want extra cooks added during busy hours (scaling).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Kubernetes is like a smart restaurant manager that:&lt;br&gt;
✔ Assigns orders (workloads) to kitchens&lt;br&gt;
✔ Makes sure dishes are cooked correctly&lt;br&gt;
✔ Adds extra cooks when needed&lt;br&gt;
✔ Reassigns work if a kitchen goes down&lt;/p&gt;

&lt;p&gt;So: Kubernetes = container orchestrator + self-healing + auto-scaling + load balancing&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Architecture&lt;/strong&gt;&lt;br&gt;
Kubernetes has two main sides:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1) Control Plane (Brain / Manager)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the decision-maker layer.&lt;/p&gt;

&lt;p&gt;Using our analogy: Think of it as the CEO and Operations Board Room. They don’t cook — they make decisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Control Plane’s jobs:&lt;/strong&gt;&lt;br&gt;
✔ Decide where containers should run&lt;br&gt;
✔ Monitor application health&lt;br&gt;
✔ Scale apps up/down&lt;br&gt;
✔ Manage configuration&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key components:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API Server — main entry point for commands&lt;/li&gt;
&lt;li&gt;Scheduler — decides where workload runs&lt;/li&gt;
&lt;li&gt;Controller Manager — ensures desired state&lt;/li&gt;
&lt;li&gt;etcd — configuration database&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2) Data Plane (Workers / Executors)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is the execution layer.&lt;/p&gt;

&lt;p&gt;Analogy: The chefs in kitchens who actually cook the food following the manager’s instructions&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Plane’s jobs:&lt;/strong&gt;&lt;br&gt;
✔ Run containers&lt;br&gt;
✔ Report health&lt;br&gt;
✔ Communicate with Control Plane&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Components:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nodes — machines (physical/virtual)&lt;/li&gt;
&lt;li&gt;Kubelet — agent on each node&lt;/li&gt;
&lt;li&gt;Container Runtime — e.g., Docker&lt;/li&gt;
&lt;li&gt;Kube-Proxy — network traffic handler&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you'd like to go deeper into Kubernetes architecture and its components, check out this article: &lt;a href="https://dev.to/anushree_gm/kubernetes-and-its-architecture-46jo"&gt;Detailed K8S Architecture&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Control Plane and Data Plane Work Together?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1) Control Plane decides what needs to be cooked and how.&lt;br&gt;
2) Data Plane (chefs) cook the meals.&lt;br&gt;
3) Each chef reports status back to the head manager:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;   "Dish done"&lt;/li&gt;
&lt;li&gt;   "Ingredients missing"&lt;/li&gt;
&lt;li&gt;   "Recipe failed"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4) Manager fixes problems automatically.&lt;/p&gt;

&lt;p&gt;In Kubernetes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Control Plane tells nodes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Start these containers”&lt;/li&gt;
&lt;li&gt;“Keep these alive”&lt;/li&gt;
&lt;li&gt;“Scale more replicas”&lt;/li&gt;
&lt;li&gt;“Move them if needed”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Data Plane/Nodes (via Kubelet):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Constantly check if containers are healthy&lt;/li&gt;
&lt;li&gt;Report to Control Plane&lt;/li&gt;
&lt;li&gt;Execute commands&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Kubernetes removes the need for manual infrastructure management.&lt;br&gt;
It ensures applications are always:&lt;br&gt;
Running&lt;br&gt;
Scalable&lt;br&gt;
Resilient&lt;br&gt;
Highly available&lt;/p&gt;

&lt;p&gt;This is why Kubernetes has become the industry standard for modern cloud applications.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>kubernetes</category>
      <category>containers</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Kubernetes and it's Architecture</title>
      <dc:creator>Anushree GM</dc:creator>
      <pubDate>Fri, 09 Jan 2026 09:47:04 +0000</pubDate>
      <link>https://dev.to/anushree_gm/kubernetes-and-its-architecture-46jo</link>
      <guid>https://dev.to/anushree_gm/kubernetes-and-its-architecture-46jo</guid>
      <description>&lt;p&gt;&lt;strong&gt;Kubernetes&lt;/strong&gt;&lt;br&gt;
Kubernetes is an orchestration system for containers. It doesn’t replace Docker; it manages many Docker containers (or other container runtimes) across multiple machines.&lt;/p&gt;

&lt;p&gt;Problems using Docker&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Single Host - Imagine 100 containers running, 1 container uses more memory, it affects other container maybe 50th 99th or any because this container does not get enough resources, it may also kill that container based on the priority. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Docker does not provide auto-healing - If container is killed app becomes inaccessible and container has to be started manually &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It does not have auto scaling.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Docker does not provide Enterprise support&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These issues can be fixed by Kubernetes &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kubernetes Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are 2 parts &lt;br&gt;
1) Control Plane - API Server, Scheduler, etcd, Control manager, Cloud control manager&lt;br&gt;
2) Data Plane - Kubelet, Kube-proxy, Container Runtime&lt;/p&gt;

&lt;p&gt;We'll start with &lt;strong&gt;Data plane&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1) &lt;strong&gt;Container runtime&lt;/strong&gt; - It is necessary to run containers like java runtime is required to run java applications&lt;br&gt;
   Container runtimes for Kubernetes include containerd and CRI-O (Dockershim was deprecated).&lt;br&gt;
2) &lt;strong&gt;Kube-proxy&lt;/strong&gt; - It handles the networking between the containers and services, like sending or distributing requests to pods/nodes i.e., load balancing, it also does assignment of IP addresses &lt;br&gt;
3) &lt;strong&gt;Kubelet&lt;/strong&gt; - It ensures Pods assigned to its node are running and healthy. It communicates with the control plane and uses the container runtime to start containers inside Pods.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Control plane&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1) &lt;strong&gt;API Server&lt;/strong&gt; - It is the core component of Kubernetes; it is the front door. All commands go through here. It stores objects (like Pods) and exposes them to other components.&lt;br&gt;
2) &lt;strong&gt;Scheduler&lt;/strong&gt;- It decides which node runs which pod. It watches for Pods that don’t have a node yet (unscheduled pods) evaluates all candidate nodes, and picks the best node based on policies and resource availability.&lt;br&gt;
3) &lt;strong&gt;etcd&lt;/strong&gt; - A key-value store for cluster state (like a database for configs). Entire cluster information is stored in it.&lt;br&gt;
4) &lt;strong&gt;Controller manager&lt;/strong&gt; - Ensures desired state (e.g., if you said 3 replicas, it keeps 3 running).&lt;/p&gt;

&lt;p&gt;The flow step-by-step&lt;br&gt;
1) You (or a controller like a Deployment) create a Pod → it’s sent to the API Server.&lt;br&gt;
2) The API Server stores the Pod (in etcd) and marks it as unscheduled (no nodeName).&lt;br&gt;
3) The Scheduler notices the unscheduled Pod, filters nodes that can’t run it, scores the remaining nodes, and binds the Pod to the chosen node via the API Server.&lt;br&gt;
4) The Kubelet on that node sees the bound Pod and starts the containers (via the container runtime).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F58m81tvkihvpr49ajwbu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F58m81tvkihvpr49ajwbu.png" alt=" " width="470" height="234"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
      <category>containers</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Ansible Fundamentals Beyond the First Playbook</title>
      <dc:creator>Anushree GM</dc:creator>
      <pubDate>Tue, 30 Dec 2025 05:38:00 +0000</pubDate>
      <link>https://dev.to/anushree_gm/ansible-fundamentals-beyond-the-first-playbook-2gb4</link>
      <guid>https://dev.to/anushree_gm/ansible-fundamentals-beyond-the-first-playbook-2gb4</guid>
      <description>&lt;p&gt;This blog continues from my previous Ansible basics blog. If you haven't gone through it yet, I recommed reading it first, where I explained Ansible fundamentals inventory, playbooks, and how to write your first playbook.&lt;br&gt;
&lt;a href="https://dev.to/anushree_gm/getting-started-with-ansible-a-beginners-guide-3deh"&gt;Ansible Fundamentals&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Variables - The basic inputs of Ansible&lt;/strong&gt;&lt;br&gt;
Variables are values that can change and are used to make playbooks flexible and reusable.&lt;/p&gt;

&lt;p&gt;Instead of hard coding information inside a playbook, we store it in variables. Variables are important because one playbook works for multiple servers and changes are easy and safe&lt;/p&gt;

&lt;p&gt;Think of it like: When you build a house, you first decide:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How many rooms?&lt;/li&gt;
&lt;li&gt;What color paint?&lt;/li&gt;
&lt;li&gt;What type of flooring?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These details can change from one house to another.&lt;/p&gt;

&lt;p&gt;Similarly, in ansible:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Server name can change&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Port number can change&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Software version can change&lt;br&gt;
These changing values are stored in variables.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to Define Variables in Ansible&lt;/strong&gt;&lt;br&gt;
1) Inside a Playbook&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---
- name: Example of Ansible Variables
  hosts: all
  vars:
    app_name: "MyApp"
    app_port: 8080
  tasks:
    - name: Print application details
      debug:
        msg: "Deploying {{ app_name }} on port {{ app_port }}"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, vars: defines variables directly in the playbook. You can reference them using {{ variable_name }}.&lt;/p&gt;

&lt;p&gt;2) In Inventory File&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[webservers]
server1 ansible_host=192.168.1.10 app_port=8080
server2 ansible_host=192.168.1.11 app_port=9090
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3) Using vars_files&lt;br&gt;
You can keep variables in a separate file for better organization&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# vars.yml
app_name: "MyApp"
app_port: 8080
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4) Passing Extra Variables at Runtime&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ansible-playbook site.yml --extra-vars "app_name=MyApp app_port=9090"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Ansible Facts&lt;/strong&gt;&lt;br&gt;
Ansible facts are pieces of information about the target system that Ansible automatically gathers when running a playbook. These include details like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;IP Addresses&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Operating system type and version&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hostname&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CPU, memory, and disk information&lt;br&gt;
Facts are collected by the setup module and stored in a dictionary called ansible_facts.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;How to Gather Facts&lt;/strong&gt;&lt;br&gt;
By default, Ansible gathers facts at the start of a playbook run. This is controlled by the gather_facts parameter in the playbook:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- name: Example Playbook
  hosts: all
  gather_facts: yes
  tasks:
    - name: Print OS family
      debug:
        msg: "OS Family is {{ ansible_facts['os_family'] }}"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you set gather_facts: no, Ansible will skip collecting facts, which can speed up execution when facts are not needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ansible roles&lt;/strong&gt;&lt;br&gt;
Roles in Ansible are a way to organize playbooks into reusable components. Instead of writing large, monolithic playbooks, roles allow you to break them down into smaller, modular pieces.&lt;/p&gt;

&lt;p&gt;Benefits of using roles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Reusability: Use the same code across multiple projects.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Maintainability: Easier to update and manage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scalability: Ideal for large environment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Standardization: Encourages best practices and consistent structure.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Structure of a role&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;roles/
  └── myrole/
      ├── tasks/        # Main list of tasks to execute
      ├── handlers/     # Handlers triggered by tasks
      ├── templates/    # Jinja2 templates for configuration files
      ├── files/        # Static files to copy
      ├── vars/         # Variables with higher precedence
      ├── defaults/     # Default variables (lowest precedence)
      └── meta/         # Role metadata (dependencies, author info)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Ansible Galaxy&lt;/strong&gt;&lt;br&gt;
Ansible Galaxy is a community hub and repository for Ansible content like roles, collections, and plugins. It’s essentially a marketplace where you can download pre-built automation content or share your own. This saves time because you don’t have to write everything from scratch.&lt;/p&gt;

&lt;p&gt;1) Install a Role from Galaxy&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ansible-galaxy role install geerlingguy.nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2) Use Installed Roles in Playbooks&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---
- hosts: webservers
  roles:
    - geerlingguy.nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3) Create your own role&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ansible-galaxy init roles/webserver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates the folder we need:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;roles/
  └── webserver/
      ├── defaults/
      │   └── main.yml
      ├── files/
      ├── handlers/
      │   └── main.yml
      ├── meta/
      │   └── main.yml
      ├── tasks/
      │   └── main.yml
      ├── templates/
      ├── vars/
      │   └── main.yml
      └── README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Converting a Simple Playbook into a Role&lt;/strong&gt;&lt;br&gt;
Original Playbook:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- hosts: webservers
  tasks:
    - name: Install Apache
      yum:
        name: httpd
        state: present

    - name: Start Apache
      service:
        name: httpd
        state: started
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Converted into Role:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# roles/webserver/tasks/main.yml
- name: Install Apache
  yum:
    name: httpd
    state: present

- name: Start Apache
  service:
    name: httpd
    state: started
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Playbook using role:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- hosts: webservers
  roles:
    - apache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>tutorial</category>
      <category>devops</category>
      <category>automation</category>
      <category>ansible</category>
    </item>
    <item>
      <title>Getting Started with Ansible: A Beginner’s Guide</title>
      <dc:creator>Anushree GM</dc:creator>
      <pubDate>Fri, 19 Dec 2025 07:13:20 +0000</pubDate>
      <link>https://dev.to/anushree_gm/getting-started-with-ansible-a-beginners-guide-3deh</link>
      <guid>https://dev.to/anushree_gm/getting-started-with-ansible-a-beginners-guide-3deh</guid>
      <description>&lt;p&gt;&lt;strong&gt;What do you think Ansible is?&lt;/strong&gt; If you’ve ever wished you could control all your servers the way you control your TV with a single remote, that’s exactly what Ansible does for IT infrastructure. Instead of logging into each machine and running commands manually, Ansible lets you automate everything from one place—like magic!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Do We Need It?&lt;/strong&gt;&lt;br&gt;
Imagine you have 10 servers and need to install the same software on all of them. Doing it one by one would take hours. Ansible solves this by letting you write a simple set of instructions (called a playbook) and apply it to all servers at once. No agents, no complicated setup—just automation made easy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Ansible?&lt;/strong&gt;&lt;br&gt;
Ansible is an open-source automation tool that helps you manage and configure multiple systems at once without having to log into each machine individually. It’s widely used for configuration management, application deployment, and orchestration.&lt;/p&gt;

&lt;p&gt;Key Features&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Agentless: No need to install software on managed machines.&lt;/li&gt;
&lt;li&gt;Uses YAML: Playbooks are written in a human-readable format.&lt;/li&gt;
&lt;li&gt;Idempotent: Running the same playbook multiple times without changing the result after the first time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the key features we have mentioned managed machines. What does that exactly mean?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Control Node (or Control Machine)
This is the system where Ansible is installed and from which you run your automation tasks (playbooks, ad-hoc commands). It acts as the central point of control.&lt;/li&gt;
&lt;li&gt;Managed Nodes (or Managed Machine)
These are the target systems that Ansible configures or automates. They don’t need Ansible installed—just connectivity (SSH or WinRM) and basic dependencies like Python.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Passwordless Authentication in Ansible&lt;/strong&gt;&lt;br&gt;
Before Ansible can manage remote servers, it needs a way to login to them automatically.&lt;br&gt;
This is where passwordless authentication becomes essential.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Passwordless Authentication?&lt;/strong&gt;&lt;br&gt;
Passwordless authentication means logging into the remote server without typing a password evertime.&lt;/p&gt;

&lt;p&gt;Instead of using passwords, we use &lt;strong&gt;SSH key-based authentication.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A private key stays on the Ansible control node&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A public key is copied to managed nodes &lt;br&gt;
When ansible connects, SSH checks the key and allows access automatically.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why does ansible need Passwordless Authentication?&lt;/strong&gt;&lt;br&gt;
Ansible is an &lt;strong&gt;automation tool.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine this situation:&lt;br&gt;
You run an Ansible playbook on 10 servers. SSH asks for a password for each server &lt;br&gt;
That breaks automation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does it work?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1) You generate an SSH key pair on the control node&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Private key: &lt;code&gt;~/.ssh/id_rsa&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Public key: &lt;code&gt;~/.ssh/id_rsa.pub&lt;/code&gt;&lt;br&gt;
Never share your private key.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2) Copy SSH Key to managed node&lt;br&gt;
Use &lt;code&gt;ssh-copy-id&lt;/code&gt; to copy the public key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-copy-id user@remote_server_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-copy-id ubuntu@192.168.2.10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll be asked for the password one last time (ubuntu user's password on 192.168.2.10).&lt;br&gt;
This allows &lt;code&gt;ssh-copy-id&lt;/code&gt; to append you public key to &lt;code&gt;/home/ubuntu/.ssh/authorized_keys&lt;/code&gt;&lt;br&gt;
After this, the server trusts your control node.&lt;/p&gt;

&lt;p&gt;3) Test Passwordless login&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh user@remote_server_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you can login without being prompted for a password, passwordless authentication is working.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Make sure remote server has password login disabled in &lt;code&gt;etc/ssh/sshd_config&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ansible inventory&lt;/strong&gt;&lt;br&gt;
When working with Ansible, the inventory is the backbone of automation. It’s essentially a list of machines (hosts) that Ansible will manage. Think of it as your address book for servers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hosts File&lt;/strong&gt;&lt;br&gt;
In Ansible, the inventory file is often called the "hosts file"&lt;br&gt;
By default, Ansible looks for this file at:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/etc/ansible/hosts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But you can also create your own custom inventory file, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;inventory.ini
hosts.ini
production.ini
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run ansible like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ansible -i inventory.ini all -m ping
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Inventory file formats&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1) Basic Inventory file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.2.13
192.168.2.14
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tells ansible to manage these two servers.&lt;/p&gt;

&lt;p&gt;2) Using Hostnames Instead of IPs&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;web1.example.com
web2.example.com
db1.example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As long as DNS works, Ansible can connect using hostnames.&lt;/p&gt;

&lt;p&gt;3) Grouped inventory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[webservers]
web1.example.com
web2.example.com

[dbservers]
db1.example.com
db2.example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Groups let you organize servers by role or purpose.&lt;br&gt;
Now you can run tasks only on web servers or only on database servers&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ansible -i inventory.ini webservers -m ping
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Ansible Ad-hoc commands&lt;/strong&gt;&lt;br&gt;
Before writing full playbooks, Ansible allows you to run quick, one-line commands called ad-hoc commands.&lt;br&gt;
Ad-hoc commands are perfect for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Quick checks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simple tasks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;One-time operations&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Basic syntax&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ansible &amp;lt;hosts&amp;gt; -m &amp;lt;module&amp;gt; -a "&amp;lt;arguments&amp;gt;"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Testing the connectivity with ping
ansible -i inventory.ini all -m ping
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ansible -i inventory.ini web -m shell -a "ls -ltr"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For modules please refer the official documentation of Ansible &lt;br&gt;
&lt;a href="https://docs.ansible.com/projects/ansible/latest/collections/ansible/builtin/index.html" rel="noopener noreferrer"&gt;Builtin modules&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Writing your first Ansible Playbook&lt;/strong&gt;&lt;br&gt;
A playbook is a YAML file that defines which hosts to target, what tasks to run and in what order.&lt;/p&gt;

&lt;p&gt;Playbook Structure&lt;br&gt;
A basic playbook has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Hosts&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Become (optional)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tasks&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;First Playbook Example&lt;/strong&gt;&lt;br&gt;
Create a file called &lt;code&gt;first-playbook.yml&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
---
- name: Install and start Nginx on all servers
  hosts: webservers
  become: true
  tasks:
    - name: Install nginx
      apt:
        name: nginx
        state: present
        update_cache: yes
    - name: Start nginx service
      service:
        name: nginx
        state: started
        enabled: yes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation&lt;br&gt;
&lt;code&gt;hosts: webservers&lt;/code&gt; - Targets the webservers group from inventory&lt;br&gt;
&lt;code&gt;become: true&lt;/code&gt; - Runs tasks with sudo&lt;/p&gt;

&lt;p&gt;Each task has a name, uses a module and defines the desired state&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Run the Playbook&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ansible-playbook -i inventory.ini first-playbook.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This first playbook is just the beginning - automation gets easier and more powerful with every step forward.&lt;/p&gt;

&lt;p&gt;Ready to go beyond the basics? I’ve written a follow‑up to this post that dives deeper into Ansible fundamentals. Check it out here:&lt;br&gt;
&lt;a href="https://dev.to/anushree_gm/ansible-fundamentals-beyond-the-first-playbook-2gb4"&gt;Ansible Fundamentals Beyond the First Playbook&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>devops</category>
      <category>automation</category>
      <category>ansible</category>
    </item>
  </channel>
</rss>
