- A collection of Hands-on labs for Ansible.
- Each lab builds on the previous one, guiding you from basic setup to advanced automation.
| Lab | Topic | Description | Build Status |
|---|---|---|---|
| 000 | Setup | Build Docker containers for Ansible labs | |
| 001 | Verify Ansible | Configure ansible.cfg, verify connectivity with ping | |
| 002 | Inventory | Create inventory files, static and dynamic inventory types | |
| 003 | Modules | Explore built-in modules, ad-hoc commands, module documentation | |
| 004 | Playbooks | Write YAML playbooks, tasks, plays, and execution flow | |
| 005 | Facts | Gather host facts, use facts in playbooks, custom facts | |
| 006 | Git Module | Clone and manage Git repositories with the git module | |
| 007 | User Management | Create users, manage passwords and SSH keys | |
| 008 | Challenges | Practice exercises combining previous lab concepts | |
| 009 | Roles | Structure playbooks into reusable roles with galaxy init | |
| 010 | Loops & Conditionals | Iterate with loops, apply conditionals with when |
|
| 011 | Jinja2 Templates | Create dynamic templates with filters, loops, and conditionals | |
| 012 | Host & Group Variables | Set per-host and per-group variables in inventory | |
| 013 | Ad-Hoc Commands | Run one-off commands without writing a playbook | |
| 014 | Playbook Variables | Define, override, and use variables in playbooks | |
| 015 | Handlers & Blocks | Trigger handlers on change, group tasks with blocks | |
| 016 | File Modules | Manage files, directories, links, and permissions | |
| 017 | Package & Service | Install packages and manage services across distros | |
| 018 | Galaxy & Collections | Install roles and collections from Ansible Galaxy | |
| 019 | Ansible Vault | Encrypt secrets, use vault passwords in playbooks | |
| 020 | Tags | Selectively run tasks with tags and skip-tags | |
| 021 | Ansible with Docker | Manage Docker containers and images via Ansible | |
| 022 | Debugging | Use debug module, verbosity, and register to troubleshoot | |
| 023 | Idempotency | Write idempotent tasks, understand changed vs ok states | |
| 024 | Ansible Lint | Lint playbooks for best practices and style issues | |
| 025 | CI/CD Jenkins | Integrate Ansible playbooks into Jenkins pipelines | |
| 026 | CI/CD GitHub Actions | Run Ansible in GitHub Actions workflows | |
| 027 | CI/CD GitLab | Integrate Ansible with GitLab CI/CD pipelines | |
| 028 | Custom Modules | Write Python-based custom Ansible modules | |
| 029 | Advanced Execution | Strategies, forks, async tasks, and run options | |
| 030 | AWX / AAP | Job Templates, Workflows, and RBAC in AWX and AAP | |
| 031 | Facts Deep Dive | Magic variables, set_fact, cached facts, and fact filtering | |
| 032 | Plugins | Callback, lookup, filter, and connection plugins | |
| 033 | Best Practices | Directory layout, naming, tagging, and security guidelines | |
| 034 | Security Hardening | Harden Linux systems with Ansible playbooks | |
| 035 | Cloud Modules | Manage AWS, GCP, and Azure resources with Ansible |
No installation required - runs entirely in your browser with all tools pre-installed.
Ansible Labs use multiple containers (controller + 3 target servers). Use Docker Compose for the full interactive environment:
git clone https://github.com/nirgeier/AnsibleLabs
cd AnsibleLabs
docker compose -f docker/docker-compose.yml up -dOpen http://localhost:3000 - left pane shows the MkDocs documentation, right pane has tabs for the Ansible controller and all three target servers.
# From GHCR (recommended)
docker run -d --name ansible-labs -p 3000:3000 ghcr.io/nirgeier/ansible-labs:latest
# From Docker Hub
docker run -d --name ansible-labs -p 3000:3000 nirgeier/ansible-labs:latestOpen http://localhost:3000 in your browser.
git clone https://github.com/nirgeier/AnsibleLabs
cd AnsibleLabs/Labs/000-setup
bash _demo.sh
