Ansible study
Offline — showing the cached copy.
Home / Ansible Labs

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

StageLabsOutcome
1. Language & discipline01–13You can write idempotent, tested roles without copy-paste
2. Operate a real host14–24Hardened, firewalled, TLS-terminated, monitored, patched, backed up
3. Performance, scale, cost25–28, 37You can find the bottleneck, right-size, and cut waste
4. Platform & security29–35Bootstrap, multi-env, AWX, external secrets, CIS evidence, game days
5. Hybrid cloud36Ansible + Floci endpoints
6. Capstone38Rebuild the VPS from bare metal in one command

Lab index

#LabLevelPrimary focus
01Lab environment, safety and baselineBeginnerTooling, inventory, safety net
02Inventory and ad-hoc commandsBeginnerInventory model, modules
03First idempotent playbookBeginnerPlaybook structure, idempotency
04Variable precedenceBeginnerPrecedence, group_vars
05Jinja2 templatingBeginnerTemplates, filters
06Handlers and idempotent restartsBeginnerNotify, handler ordering
07Conditionals, loops and blocksIntermediateControl flow, error blocks
08Roles and dependenciesIntermediateRole design, reuse
09Collections and version pinningIntermediateSupply chain
10Vault and secret hygieneIntermediateSecrets management
11Error handling and delegationIntermediateFailure control, serial
12Dynamic inventoryIntermediateInventory plugins, Floci
13Lint, Molecule and CIIntermediateTesting pipeline
14VPS baseline hardeningIntermediateUsers, SSH, sysctl, patches
15Firewall: ufw, nftables and DockerIntermediateLeast-privilege network
16fail2ban and brute-force defenceIntermediateAbuse resistance
17TLS certificates and renewalIntermediateCertificate lifecycle
18Nginx reverse proxyIntermediateEdge config, rate limits
19systemd units and timersIntermediateService supervision
20Log rotation and journaldIntermediateRetention, disk safety
21Backups and restore drillsAdvancedRPO/RTO, off-box
22Docker lifecycle managementIntermediateCompose, health, prune
23Monitoring stack rolloutAdvancedMetrics, logs, dashboards
24Patching and rolling upgradesAdvancedZero-downtime maintenance
25Kernel and service tuningAdvancedSysctl, limits, bench
26Capacity planning and scale-outAdvancedLoad test, bottlenecks
27Cost and waste auditAdvancedFinOps on a host
28Drift and compliance auditAdvancedCheck mode, assertions
29Bootstrap and ansible-pullAdvancedDay-0 automation
30Multi-environment inventoryAdvancedEnv separation
31AWX or SemaphoreAdvancedCentral execution, RBAC
32External secrets integrationAdvancedVault/SOPS/SSM
33SLO alerting and on-callAdvancedReliability engineering
34CIS hardening and evidenceAdvancedAudit-ready compliance
35Game day and runbooksAdvancedFailure practice
36Cloud modules against FlociAdvancedHybrid Ansible
37Ansible performance at scaleExpertForks, pipelining, strategy
38Capstone: rebuild the VPSExpertFull 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.

  1. 01Lab 01 — Lab environment and safety
  2. 02Lab 02 — Inventory and ad-hoc commands
  3. 03Lab 03 — First idempotent playbook
  4. 04Lab 04 — Variable precedence
  5. 05Lab 05 — Jinja2 templating
  6. 06Lab 06 — Handlers and idempotent restarts
  7. 07Lab 07 — Conditionals, loops and blocks
  8. 08Lab 08 — Roles and dependencies
  9. 09Lab 09 — Collections and version pinning
  10. 10Lab 10 — Vault and secret hygiene
  11. 11Lab 11 — Error Handling and Delegation
  12. 12Lab 12 — Dynamic Inventory
  13. 13Lab 13 — Lint, Molecule and CI
  14. 14Lab 14 — VPS Baseline Hardening
  15. 15Lab 15 — Firewall: ufw, nftables and Docker
  16. 16Lab 16 — fail2ban and Brute-Force Defence
  17. 17Lab 17 — TLS Certificates and Renewal
  18. 18Lab 18 — Nginx Reverse Proxy
  19. 19Lab 19 — systemd Units and Timers
  20. 20Lab 20 — Log Rotation, Journald Caps and Disk-Growth Forensics
  21. 21Lab 21 — Encrypted Backups and Restore Drills
  22. 22Lab 22 — Docker Lifecycle Management
  23. 23Lab 23 — Monitoring Stack Rollout
  24. 24Lab 24 — Patching and Rolling Upgrades
  25. 25Lab 25 — Kernel and Service Tuning
  26. 26Lab 26 — Capacity Planning and Scale-Out
  27. 27Lab 27 — Cost and Waste Audit
  28. 28Lab 28 — Drift and Compliance Audit
  29. 29Lab 29 — Bootstrap and ansible-pull
  30. 30Lab 30 — Multi-Environment Inventory
  31. 31Lab 31 — AWX or Semaphore
  32. 32Lab 32 — External Secrets Integration
  33. 33Lab 33 — SLO Alerting and On-Call
  34. 34Lab 34 — CIS Hardening and Evidence
  35. 35Lab 35 — Game Day and Runbooks
  36. 36Lab 36 — Cloud Modules against Floci
  37. 37Lab 37 — Performance at Scale
  38. 38Lab 38 — Capstone: Rebuild the VPS