One of the most comprehensive collections of production-ready Ansible on GitHub.
150+ idempotent playbooks · reusable roles · Molecule tests · inventories · docs — all linted to the ansible-lint production profile.
Most Ansible examples online are toy snippets that break on the second run or use deprecated modules. This repository is different: every playbook is idempotent, FQCN-based, production-safe, and CI-linted to the strictest profile — the automation you actually want to run against real fleets.
⭐ If this saves you time, star the repo — it helps other engineers find it.
- Production, not toys. Idempotent,
--check-friendly, explicit file modes,state: presentoverlatest, documented rollback and validation steps. - Modern and safe. Targets
ansible-core >= 2.15, Fully Qualified Collection Names, no deprecated modules. CI enforcesansible-lintproduction profile. - Tested. Reusable roles ship Molecule scenarios; custom plugins/modules have pytest unit tests.
- Comprehensive. Linux, networking, storage, monitoring, logging, containers, Kubernetes, OpenStack, databases, security hardening, certificates, backups.
git clone https://github.com/devopsaitoolkit/ansible-playbooks.git
cd ansible-playbooks
pip install -r requirements.txt
ansible-galaxy collection install -r requirements.yml -p collections
# Dry-run a playbook against your inventory
ansible-playbook playbooks/linux/baseline.yml -i inventories/dev/hosts.ini --check --diff| Area | Contents |
|---|---|
📜 playbooks/ |
150+ playbooks, grouped by domain |
🧩 roles/ |
Reusable roles with Molecule scenarios |
🗂️ inventories/ |
dev, staging, prod, multi-region, hybrid, OpenStack, VMware, AWS, Azure, GCP |
🧠 filter_plugins/ · library/ |
Custom Jinja2 filters and a module (pytest-tested) |
📚 docs/ |
Best practices, Vault, Molecule, Jinja2, idempotency, CI/CD + diagrams |
🔧 scripts/ |
lint, syntax-check, molecule, inventory validate, vault, scaffolding |
| Domain | Examples |
|---|---|
| Linux | baseline, packages, users, SSH, sysctl, systemd, kernel, NTP/chrony |
| Storage | LVM, filesystem growth, disk expansion, mounts |
| Networking | interfaces, firewall (ufw/firewalld/nftables), DNS, bonding |
| Containers | Docker, Compose, Podman, registry login, cleanup, image management |
| Kubernetes | kubectl, Helm, node prep, kubeconfig distribution |
| OpenStack | clouds.yaml, application credentials, Nova/Neutron/Cinder/Glance/Keystone, Kolla |
| Databases | MySQL/MariaDB, PostgreSQL, Redis, RabbitMQ |
| Web | NGINX, Apache, TLS, reverse proxy |
| Monitoring · Logging | node_exporter, Grafana Agent, Telegraf, Prometheus, rsyslog, Loki |
| Security | CIS baselines, SSH hardening, firewall, fail2ban, auditd |
| Certificates · Backup · Patching | Let's Encrypt, internal CA, restic/borg, patch management |
| Storage systems · CI runners | Ceph, LINSTOR, GitLab/GitHub runners |
Browse the searchable index, the platform support matrix, and the decision tree for picking the right playbook.
- name: Configure web servers
hosts: web
become: true
roles:
- role: common
- role: security
- role: dockerSee roles/ — each role has a README, defaults, handlers, templates,
and a Molecule scenario. The role compatibility matrix
shows what runs where.
DevOps & Platform Engineers · SREs · Linux & Cloud administrators · OpenStack operators · Kubernetes administrators · automation engineers.
Operator experience is what makes this library great. Adding a playbook takes 20 minutes and helps the whole community.
- 📄 Contributing guide
- ➕ Request a playbook or role
- 💬 Discussions
- 🧭 Roadmap — Galaxy collection, CLI, MCP server, VS Code extension
By participating you agree to our Code of Conduct.
Apache-2.0. Use the playbooks and roles freely in your own infrastructure.
This repository stands on its own. To go deeper on AI-assisted automation, these free resources from the maintainers help you keep learning:
- 📚 Advanced automation & Ansible guides
- 🧪 Infrastructure & YAML validators
- 🤖 AI Incident Response Assistant
- 💡 Prompt library
- ✉️ Weekly DevOps newsletter
Built by engineers who automate production fleets for a living. If it helps you, give it a ⭐.