Day 60 of 90 Days of DevOps Challenge: Ansible Architecture and Setup

Vaishnavi DVaishnavi D
3 min read

Yesterday (Day 59), I began exploring the world of Ansible by understanding what Configuration Management is, why it’s essential in DevOps, and how Ansible stands out with its agentless architecture, YAML syntax, and ease of use. That session was all about setting the stage, introducing key concepts and the role Ansible plays in automating software configuration, deployment, and orchestration.

Today, I focused on understanding the Ansible architecture and performed a full setup of Ansible on Amazon Linux EC2 instances to prepare for real-world automation tasks.

Ansible Architecture Overview

Ansible follows a simple, agentless architecture that makes it easy to automate tasks across multiple systems without installing any software on the target nodes.

Core Components of Ansible Architecture

ComponentDescription
Control Node (Master)The machine where Ansible is installed and from where all commands and playbooks are executed.
Managed Nodes (Hosts/Clients)Target machines (Linux, Windows, etc.) where tasks are executed. These don’t need any agent—just SSH (Linux) or WinRM (Windows).
InventoryA file (usually hosts or inventory) that lists the IP addresses or hostnames of all managed nodes. Can be static or dynamic.
ModulesUnits of work Ansible executes (e.g., installing packages, creating files). Comes with hundreds of built-in modules.
PluginsExtend Ansible’s core functionality (e.g., connection plugins, callback plugins, lookup plugins).
PlaybooksYAML files that define what tasks to run and on which hosts. These are the heart of Ansible automation.
RolesPredefined directory structures that help organize playbooks and related files for better reuse and scalability.

How Ansible Works

  1. User runs a playbook or command from the control node.

  2. Ansible reads the inventory file to determine which hosts to target.

  3. It connects to managed nodes using SSH (or WinRM for Windows).

  4. It executes tasks defined in the playbook using modules.

  5. Results are returned to the control node, no agent required on the targets.

Key Concepts

  • Agentless: No need to install any daemon on target systems.

  • Push-based: The control node pushes instructions to hosts.

  • Idempotent: Running the same playbook multiple times won’t change the system if it's already in the desired state.

  • Declarative-ish: You describe the desired state, and Ansible figures out the steps to reach it.

Ansible Architecture Diagram (Text Version)

              +-----------------+              
              |  Control Node   |  <-- Runs Playbooks, CLI Commands
              +--------+--------+
                       |
            SSH / WinRM Connection
                       |
       +---------------+--------------+
       |       Managed Node 1         |
       |       (e.g., Web Server)     |
       +------------------------------+
       |       Managed Node 2         |
       |       (e.g., DB Server)      |
       +------------------------------+
       |       Managed Node N         |
       |       (e.g., Cache Server)   |
       +------------------------------+

Ansible Setup Reference

To avoid writing installation steps manually, I’ve documented the entire Ansible setup process Including:

  • Creating a dedicated ansible user

  • Configuring passwordless sudo access

  • Setting up SSH keys between Control and Managed Nodes

  • Installing Ansible using Python pip3

  • Configuring the inventory file and testing connectivity

Complete Setup Guide:

Ansible Setup on Amazon Linux – GitHub

This guide walks through each step with commands and explanations, making it easy to reproduce the environment or troubleshoot if something breaks.

By following this, I now have a fully functional Ansible environment ready for automation!

Final Thoughts

Today was a major milestone in my DevOps journey. I now understand the architecture of Ansible and have a fully configured setup ready to automate real-world tasks.

The beauty of Ansible lies in its simplicity, agentless nature, and declarative approach, making it one of the most efficient tools for configuration management and orchestration. next, I’ll dive into writing and executing my first Ansible Playbooks to automate software installation, service management, and more across multiple machines.

Stay tuned for more hands-on automation as I bring my infrastructure to life with Ansible!

0
Subscribe to my newsletter

Read articles from Vaishnavi D directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Vaishnavi D
Vaishnavi D