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 serversYour First Playbook
  2. Install and start nginx idempotentlyIdempotency, Modules
  3. Create users with individual SSH keysCase Study: User and SSH Access
  4. Deploy a templated config fileTemplates for Config Generation
  5. Package it as a roleRole Structure
  6. Split dev/staging/production cleanlyCase Study: Multi-Environment Inventory
  7. Roll out a change with a canary batchCase Study: Rolling Nginx Deployment
  8. Encrypt a secret with VaultSecrets and Vault
  9. Add CI linting and a --check gateCI/CD and Linting
  10. Write a custom moduleBuild a Custom Module
  11. Package it into a collectionBuild a Collection From Zero
  12. Tune a slow playbook at scaleForks, Serial, Strategy, and Throttle, Performance

Every Section

Further Reading