What is Ansible?
Why it exists and what problem it solves
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.
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.
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).
| Tool | Agent? | Language | Best for |
|---|---|---|---|
| Ansible | No (SSH) | YAML | Config management, orchestration |
| Puppet | Yes | Puppet DSL | Large-scale compliance |
| Chef | Yes | Ruby | Complex app deployment |
| Terraform | No (API) | HCL | Cloud provisioning |