NetwNETW
Ansible course
CHAPTER 01

What is Ansible?

Why it exists and what problem it solves

10 min read4 sections
In this chapter
The problemThe solutionHow it worksAnsible vs other tools

01The problem

You have 50 servers. They all need the same config change: install nginx, open port 80, start the service. Doing it by hand takes hours. Shell scripts are fragile. Puppet and Chef require agents and custom languages.

Why this exists

Before Ansible, sysadmins used shell scripts, Puppet, or Chef. Shell scripts break when things change. Puppet and Chef require installing an agent on every machine and learning a custom language. Ansible is agentless: it uses SSH, which every Linux machine already has. And it uses YAML, which is easy to read.

02The solution

Ansible is a tool that automates IT tasks. You write a playbook (a YAML file) describing what you want. Ansible connects to your machines over SSH and makes it happen. No agents to install. No custom language to learn.

Mental model

Think of Ansible as a remote control for your servers. You press a button (run a playbook) and all the TVs (servers) change channel at once.

03How it works

Ansible has three parts: a control node (your laptop), an inventory (list of machines), and playbooks (YAML files describing tasks). Ansible connects over SSH, runs modules on each target, and reports results.

  • ▸Control node: where Ansible runs. No agent needed on targets.
  • ▸Inventory: a file listing machines, grouped by role.
  • ▸Playbook: a YAML file describing what to do.
  • ▸SSH: Ansible connects as a user. Uses sudo (become) for privileged tasks.
  • ▸Idempotency: running twice does nothing extra if state is already correct.

04Ansible vs other tools

Ansible is agentless (SSH), uses YAML, and is easy to learn. Puppet and Chef require agents and custom languages. Terraform provisions infrastructure (cloud resources), Ansible configures it (software on the servers).

ToolAgent?LanguageBest for
AnsibleNo (SSH)YAMLConfig management, orchestration
PuppetYesPuppet DSLLarge-scale compliance
ChefYesRubyComplex app deployment
TerraformNo (API)HCLCloud provisioning
Check your understanding
0 / 1 correct
What makes Ansible agentless?