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:

  1. Control Node (Controller)

  2. Managed Nodes (Target Machines)

  3. 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 (Servers I Control)

These are the remote servers where Ansible performs tasks like:

  • installing packages

  • creating users

  • deploying applications

  • starting services

What I found interesting:

👉 Managed nodes don’t need Ansible installed.
👉 SSH access is enough.

This is why Ansible is called agentless, and this is one of the biggest reasons teams prefer it.


3. Inventory – Server List

The inventory tells Ansible which servers to connect to.

Example INI format I used:

[web] 192.168.1.10 192.168.1.11 [db] 192.168.1.20

YAML example:

all: children: web: hosts: web1: ansible_host: 192.168.1.10

Inventory is basically the “address book” for Ansible.


Architecture Diagram (How I Visualized It)

+-------------------+ SSH +----------------------+ | Ansible Control | ----------------> | Managed Node 1 | | Machine | | (EC2 / VM / Server)| +-------------------+ +----------------------+ SSH +----------------------+ ----------------> | Managed Node 2 | +----------------------+

This diagram made the architecture very easy for me to remember.


Putting It All Together (My Practice Flow)

Here’s how everything fits when I run a playbook:

  1. I install Ansible on the controller

  2. I create an inventory with my server IPs

  3. I write a YAML playbook

  4. I run it using ansible-playbook

  5. Ansible connects via SSH

  6. Modules execute tasks

  7. Server configuration changes automatically

This simple workflow made automation feel powerful and smooth.


Quick Example (Architecture In Action)

Inventory:

[web] 54.23.10.12 ansible_user=ubuntu ansible_ssh_private_key_file=key.pem

Playbook:

- hosts: web become: yes tasks: - name: Install nginx apt: name: nginx state: present

Command:

ansible-playbook -i inventory.ini install-nginx.yml

Ansible → SSH → Managed Node → Task Completed ✔


Final Thoughts

Ansible’s architecture is one of the simplest in DevOps.
No agents, no extra services — just:

  • one control machine

  • multiple target machines

  • one inventory

  • and SSH

Once this clicked for me, learning modules, playbooks, and inventory management became much easier.

Next, I will write about Ansible Modules — the building blocks of all automation.

Comments

Popular posts from this blog

Ansible Playbooks – How I Learned to Automate Complete Tasks

Understanding Ansible Modules

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