Skip to content

Ansible

Ansible lets you describe the state a machine should be in — packages installed, files in place, services running — and repeatedly converge real machines toward that state over SSH, with nothing installed on them beforehand. This is a hands-on guide to using it well: writing production playbooks, understanding what's happening underneath them, debugging what breaks, and building your own modules and collections when nothing built-in fits.

It's built to work two ways: read it start to finish as a course, or jump straight to the one page that answers what you need right now.

Start Here, Based on Where You Are

You are... Start at
New to Ansible entirely Getting Started
Comfortable with the basics, want the daily-driver skills Core Concepts
Writing playbooks already, want to level up Playbook Engineering, Modules
Managing a large fleet, run times are slow Advanced Execution
Setting up a real project from scratch Production Engineering
Extending Ansible — a custom module or collection Build Your Own
Evaluating or administering Red Hat AAP / AWX Enterprise Platform (AAP & AWX)
Something's broken right now Troubleshooting
Prepping for an Ansible or DevOps interview Interview Preparation
Already know Ansible, need a fast lookup Quick Reference

The Learning Path

flowchart TD
    A[Getting Started] --> B[Core Concepts]
    B --> C[Variables & Data / Jinja2]
    C --> D[Modules / Playbook Engineering]
    D --> E[Roles / Collections]
    E --> F[Advanced Execution /\nProduction Engineering]
    F --> G[Build Your Own\nModules & Collections]
    G --> H[Interview Preparation]

Learn by Building

Each project uses only what the previous ones already taught you. Skip ahead if you're already past a stage.

  1. Ping three servers — Your First Playbook
  2. Install and start nginx idempotently — Idempotency, Modules
  3. Create users with individual SSH keys — Case Study: User and SSH Access
  4. Deploy a templated config file — Templates for Config Generation
  5. Package it as a role — Role Structure
  6. Split dev/staging/production cleanly — Case Study: Multi-Environment Inventory
  7. Roll out a change with a canary batch — Case Study: Rolling Nginx Deployment
  8. Encrypt a secret with Vault — Secrets and Vault
  9. Add CI linting and a --check gate — CI/CD and Linting
  10. Write a custom module — Build a Custom Module
  11. Package it into a collection — Build a Collection From Zero
  12. Tune a slow playbook at scale — Forks, Serial, Strategy, and Throttle, Performance

Every Section

Further Reading