InfraMaxx

Track

Ansible & Configuration lessons

40 short lessons on Ansible & Configuration. Each one starts from a real situation, shows how it works, and ends with a quiz. Free to read.

Start with the first lesson

All 40 lessons

  1. InventoryBeginner · 4 min

    An Ansible inventory identifies managed hosts and organizes them into groups with variables.

  2. SSH transportBeginner · 4 min

    SSH transport connects Ansible controller to managed nodes.

  3. Privilege escalationBeginner · 4 min

    Privilege escalation runs tasks as another user via become.

  4. Dynamic inventoryBeginner · 4 min

    Dynamic inventory discovers machines through an external provider.

  5. Declarative modulesBeginner · 4 min

    Declarative modules converge systems to a desired state.

  6. HandlersBeginner · 4 min

    Handlers run when notified by changed tasks.

  7. Check modeBeginner · 4 min

    Check mode previews tasks without committing changes when supported.

  8. changed_whenBeginner · 4 min

    changed_when overrides a task change assessment.

  9. RoleBeginner · 4 min

    Role packages tasks handlers defaults and templates.

  10. Jinja2 templateBeginner · 4 min

    Jinja2 template renders variable-driven configuration files.

  11. VaultBeginner · 4 min

    Vault encrypts secrets stored with Ansible.

  12. TagsBeginner · 4 min

    Tags limit task execution to selected subsets.

  13. Serial rolling updatesBeginner · 5 min

    Serial rolling updates limits batch size across hosts.

  14. Delegate_toBeginner · 5 min

    Delegate_to runs a task on a different machine.

  15. Async tasksBeginner · 4 min

    Async tasks start long-running remote operations.

  16. Inventory designBeginner · 4 min

    Explain how Ansible inventory groups decide which hosts a play touches. Designing groups by role and location keeps each run narrow and easy to check before it starts.

  17. Group variables precedenceIntermediate · 4 min

    Explain how Ansible ranks variables from group files, playbook vars and extra vars. The highest-ranked source wins, so a copied value in a playbook can hide every group…

  18. Host variablesIntermediate · 4 min

    Explain how host variables and host_vars files set one host's values above its group. A host file gives an exception without copying the group's default into every host.

  19. Idempotent modulesIntermediate · 4 min

    Explain why a good Ansible playbook reports no changes on a second run. Modules check state before acting, while raw commands run each time unless a guard stops them.

  20. changed_when guardsIntermediate · 4 min

    Explain how changed_when and failed_when turn a command's exit code or output into Ansible's changed and failed outcomes. Correct guards stop handlers from firing on…

  21. Handler notificationsIntermediate · 4 min

    Explain how handler notifications work. A task that changes something notifies a handler by name, and the handler runs once per play at a defined point. Renames can…

  22. Template renderingIntermediate · 4 min

    Explain how the template module renders a Jinja2 file per host and reports changed only when the rendered text differs. Validate and diff steps keep a broken or…

  23. Jinja escapingIntermediate · 4 min

    Explain how Jinja2 decides what to render, and how to write template text that contains braces or percent signs without Jinja changing it. Escape once, at one stage…

  24. Vault secretsIntermediate · 5 min

    Explain how Ansible Vault encrypts files and single values so they can live in version control. Vault protects data at rest, and it stops protecting once a run decrypts…

  25. Role structureAdvanced · 4 min

    Explain the standard Ansible role layout and where each kind of content belongs. Defaults hold values that callers may override, and vars hold values the role must…

  26. CollectionsAdvanced · 4 min

    Explain what an Ansible collection is and why fully qualified names and pinned versions make a run repeatable. A collection bundles roles, modules and plugins under one…

  27. Tags and limitsAdvanced · 4 min

    Explain how --limit filters hosts and tags filter tasks, and why each one can select more or less than expected. Listing hosts and tasks before a run shows the real…

  28. Diff modeAdvanced · 4 min

    Explain how check mode and diff mode show the file changes a run would make, without writing them. Reviewing one host's diff before a wider rollout catches surprises…

  29. Rolling updatesAdvanced · 4 min

    Roll a change through an Ansible fleet in batches with serial, so part of the service keeps answering while each group updates, and a drain step keeps traffic away from…

  30. serial batchesAdvanced · 4 min

    Read serial values, percentages and failure thresholds together, so you know which hosts have already changed when a play stops during a rollout, and how percentage…

  31. Failure rescue blocksAdvanced · 4 min

    Use block, rescue and always to run recovery steps when a task fails, and treat a rescued host in the run recap as a problem to check before the release is called done.

  32. Ansible factsAdvanced · 4 min

    Read Ansible facts through ansible_facts, know when gather_facts is off, and check the fact a condition reads before trusting its branch on each host, using a debug…

  33. Performance tuningAdvanced · 4 min

    Measure task time first, then change forks, pipelining or fact gathering one at a time, and watch control node load and shared services, so a faster run does not hide a…

  34. Molecule testingAdvanced · 4 min

    Test a role on a clean instance with Molecule, using a scenario, a converge step and a verify step that checks the real result, not just that a package exists.

  35. Patch managementAdvanced · 4 min

    Plan OS patching as a cycle of inventory, staged test, batched apply, reboot and verify, using the apt upgrade option deliberately rather than as a blanket upgrade.

  36. Vault secrets: operational verificationAdvanced · 4 min

    Encrypt secrets with ansible-vault, supply the password at run time, and verify that a run decrypts the value with the right password and fails with the wrong one.

  37. Role structure: failure analysisAdvanced · 4 min

    Use the standard role layout so each setting has one home: user settings in defaults, internal values in vars, and tasks, handlers and templates in their own folders.

  38. Collections: operational verificationAdvanced · 4 min

    Name every module with its fully qualified collection name and pin collection versions in a requirements file, so the same playbook gives the same result on each…

  39. Tags and limits: failure analysisAdvanced · 4 min

    Use --tags, --skip-tags and --limit to narrow a run, and list the tags and hosts first, so a typo selects nothing without anyone noticing. Check the list output before…

  40. Check mode: operational verificationAdvanced · 4 min

    Use check mode with diff output to preview supported changes, and treat every skipped task as a gap that needs a real test before the run.