Ansible Labs
Configuration management for the VPS (Ubuntu 20.04, 4 vCPU / 5.8 GB) and, from lab 36, for cloud resources emulated by Floci.
The through-line: make a real host reproducible, hardened, observable, fast, and cheap — then prove it by rebuilding it from zero.
Start here: labs/lab-01-lab-environment-and-safety/
Learning path
| Stage | Labs | Outcome |
|---|---|---|
| 1. Language & discipline | 01–13 | You can write idempotent, tested roles without copy-paste |
| 2. Operate a real host | 14–24 | Hardened, firewalled, TLS-terminated, monitored, patched, backed up |
| 3. Performance, scale, cost | 25–28, 37 | You can find the bottleneck, right-size, and cut waste |
| 4. Platform & security | 29–35 | Bootstrap, multi-env, AWX, external secrets, CIS evidence, game days |
| 5. Hybrid cloud | 36 | Ansible + Floci endpoints |
| 6. Capstone | 38 | Rebuild the VPS from bare metal in one command |
Lab index
| # | Lab | Level | Primary focus |
|---|---|---|---|
| 01 | Lab environment, safety and baseline | Beginner | Tooling, inventory, safety net |
| 02 | Inventory and ad-hoc commands | Beginner | Inventory model, modules |
| 03 | First idempotent playbook | Beginner | Playbook structure, idempotency |
| 04 | Variable precedence | Beginner | Precedence, group_vars |
| 05 | Jinja2 templating | Beginner | Templates, filters |
| 06 | Handlers and idempotent restarts | Beginner | Notify, handler ordering |
| 07 | Conditionals, loops and blocks | Intermediate | Control flow, error blocks |
| 08 | Roles and dependencies | Intermediate | Role design, reuse |
| 09 | Collections and version pinning | Intermediate | Supply chain |
| 10 | Vault and secret hygiene | Intermediate | Secrets management |
| 11 | Error handling and delegation | Intermediate | Failure control, serial |
| 12 | Dynamic inventory | Intermediate | Inventory plugins, Floci |
| 13 | Lint, Molecule and CI | Intermediate | Testing pipeline |
| 14 | VPS baseline hardening | Intermediate | Users, SSH, sysctl, patches |
| 15 | Firewall: ufw, nftables and Docker | Intermediate | Least-privilege network |
| 16 | fail2ban and brute-force defence | Intermediate | Abuse resistance |
| 17 | TLS certificates and renewal | Intermediate | Certificate lifecycle |
| 18 | Nginx reverse proxy | Intermediate | Edge config, rate limits |
| 19 | systemd units and timers | Intermediate | Service supervision |
| 20 | Log rotation and journald | Intermediate | Retention, disk safety |
| 21 | Backups and restore drills | Advanced | RPO/RTO, off-box |
| 22 | Docker lifecycle management | Intermediate | Compose, health, prune |
| 23 | Monitoring stack rollout | Advanced | Metrics, logs, dashboards |
| 24 | Patching and rolling upgrades | Advanced | Zero-downtime maintenance |
| 25 | Kernel and service tuning | Advanced | Sysctl, limits, bench |
| 26 | Capacity planning and scale-out | Advanced | Load test, bottlenecks |
| 27 | Cost and waste audit | Advanced | FinOps on a host |
| 28 | Drift and compliance audit | Advanced | Check mode, assertions |
| 29 | Bootstrap and ansible-pull | Advanced | Day-0 automation |
| 30 | Multi-environment inventory | Advanced | Env separation |
| 31 | AWX or Semaphore | Advanced | Central execution, RBAC |
| 32 | External secrets integration | Advanced | Vault/SOPS/SSM |
| 33 | SLO alerting and on-call | Advanced | Reliability engineering |
| 34 | CIS hardening and evidence | Advanced | Audit-ready compliance |
| 35 | Game day and runbooks | Advanced | Failure practice |
| 36 | Cloud modules against Floci | Advanced | Hybrid Ansible |
| 37 | Ansible performance at scale | Expert | Forks, pipelining, strategy |
| 38 | Capstone: rebuild the VPS | Expert | Full reproducibility |
Directory convention for your own work
~/iac-work/ansible/
├── ansible.cfg
├── requirements.yml
├── inventories/
│ ├── lab/hosts.yml
│ └── prod/hosts.yml
├── group_vars/
├── host_vars/
├── roles/
└── playbooks/
Do not put your implementation inside this curriculum folder.
- 01Lab 01 — Lab environment and safety
- 02Lab 02 — Inventory and ad-hoc commands
- 03Lab 03 — First idempotent playbook
- 04Lab 04 — Variable precedence
- 05Lab 05 — Jinja2 templating
- 06Lab 06 — Handlers and idempotent restarts
- 07Lab 07 — Conditionals, loops and blocks
- 08Lab 08 — Roles and dependencies
- 09Lab 09 — Collections and version pinning
- 10Lab 10 — Vault and secret hygiene
- 11Lab 11 — Error Handling and Delegation
- 12Lab 12 — Dynamic Inventory
- 13Lab 13 — Lint, Molecule and CI
- 14Lab 14 — VPS Baseline Hardening
- 15Lab 15 — Firewall: ufw, nftables and Docker
- 16Lab 16 — fail2ban and Brute-Force Defence
- 17Lab 17 — TLS Certificates and Renewal
- 18Lab 18 — Nginx Reverse Proxy
- 19Lab 19 — systemd Units and Timers
- 20Lab 20 — Log Rotation, Journald Caps and Disk-Growth Forensics
- 21Lab 21 — Encrypted Backups and Restore Drills
- 22Lab 22 — Docker Lifecycle Management
- 23Lab 23 — Monitoring Stack Rollout
- 24Lab 24 — Patching and Rolling Upgrades
- 25Lab 25 — Kernel and Service Tuning
- 26Lab 26 — Capacity Planning and Scale-Out
- 27Lab 27 — Cost and Waste Audit
- 28Lab 28 — Drift and Compliance Audit
- 29Lab 29 — Bootstrap and ansible-pull
- 30Lab 30 — Multi-Environment Inventory
- 31Lab 31 — AWX or Semaphore
- 32Lab 32 — External Secrets Integration
- 33Lab 33 — SLO Alerting and On-Call
- 34Lab 34 — CIS Hardening and Evidence
- 35Lab 35 — Game Day and Runbooks
- 36Lab 36 — Cloud Modules against Floci
- 37Lab 37 — Performance at Scale
- 38Lab 38 — Capstone: Rebuild the VPS