Ansible labs - 20 hands-on challenges
Solve 20 real Ansible challenges in an isolated container in your browser. No setup, no fake shells.
- Repair the Broken Inventory - beginner · Fix group names, a missing host and a wrong port so every production host is reachable.
- Make the Playbook Parse - beginner · Fix tabs, a mapping used where a list belongs, and a missing play key.
- Stop the Duplicate Config - beginner · Replace shell append/mkdir/chmod with real modules so the play converges.
- The Handler That Never Fired - beginner · Fix a notify/handler name mismatch that silently skips the service restart.
- Which Variable Actually Wins - beginner · Untangle a value defined in four places at four precedence levels.
- Templates That Survive Missing Variables - beginner · Fix an undefined variable and a list/string type error in a Jinja2 template.
- Loops Over Dictionaries and Honest Conditionals - beginner · Fix a dict looped as a list and a condition that is false on every host.
- Honest changed/failed Semantics for Commands - intermediate · Control creates/changed_when/failed_when on commands that cannot be replaced by modules.
- One Line, One Block, Every Time - intermediate · Fix a regexp that never matches and two blockinfile tasks sharing a marker.
- Put the Role Back in Its Standard Layout - intermediate · Restore the conventional role directories so Ansible can load it at all.
- Fail Safely - block / rescue / always - intermediate · Replace ignore_errors with real rollback and guaranteed cleanup.
- Get the Database Password Out of Git - intermediate · Encrypt a rotated credential with Vault and wire up the passphrase file.
- Connect As Who You Really Are - intermediate · Remove a hardcoded remote_user and blanket sudo escalation these hosts cannot provide.
- Tags for Surgical Runs - intermediate · Add tags so operators can push config only during a change freeze.
- --check Must Be a Real Dry Run - advanced · Stop a dry run from mutating hosts, and stop it crashing on a skipped command.
- Never Take the Whole Tier Down - advanced · Batch a rollout so at least one web server is always in service.
- Do the Work Where It Belongs, Once - advanced · Send load-balancer registration to the load balancer and announce once per release.
- Gather Only the Facts You Need - advanced · Fix inverted fact gathering and enable a real fact cache.
- Refuse the Deploy Before It Starts - advanced · Add assertions that reject bad inputs before any host is modified.
- Let the CMDB Drive the Inventory - advanced · Implement the dynamic inventory JSON contract against a live source of truth.