// the find
geerlingguy/ansible-for-devops
Ansible for DevOps examples.
The companion code repository for Jeff Geerling's 'Ansible for DevOps' book — 16 chapters of worked examples covering provisioning, deployments, Docker, Kubernetes, security hardening, and CI with Molecule. This is reference material first, a reusable template library second. If you own the book, you want this repo; if you don't, the examples are still readable but lose a lot of context.
Each example is self-contained with its own Vagrantfile and requirements.yml, so you can spin up and run any chapter independently without touching the rest. The progression from single-file playbooks to roles to collections mirrors how real Ansible projects grow, making it useful for onboarding. CI runs against the actual playbooks on every push, so the examples are verified to work rather than being aspirational. The deployment examples cover zero-downtime rolling deploys and HAProxy drain/rejoin — patterns that are genuinely tricky to get right and rarely shown end-to-end.
Most examples target CentOS/RHEL, which is a poor default in 2025 given CentOS's EOL and the industry shift to Ubuntu/Debian. The Vagrant/VirtualBox dependency is a real friction point — if you're on a machine where VirtualBox doesn't work well (Apple Silicon, some CI environments), about half the examples become difficult to run. The Kubernetes chapter was written for an older kubeadm flow and includes Helm v2 (Tiller) artifacts that are deprecated and removed in current clusters. Some examples use `include` instead of `include_tasks`/`import_tasks`, which Ansible has deprecated and will eventually break.