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.
All 40 lessons
- InventoryBeginner · 4 min
An Ansible inventory identifies managed hosts and organizes them into groups with variables.
- SSH transportBeginner · 4 min
SSH transport connects Ansible controller to managed nodes.
- Privilege escalationBeginner · 4 min
Privilege escalation runs tasks as another user via become.
- Dynamic inventoryBeginner · 4 min
Dynamic inventory discovers machines through an external provider.
- Declarative modulesBeginner · 4 min
Declarative modules converge systems to a desired state.
- HandlersBeginner · 4 min
Handlers run when notified by changed tasks.
- Check modeBeginner · 4 min
Check mode previews tasks without committing changes when supported.
- changed_whenBeginner · 4 min
changed_when overrides a task change assessment.
- RoleBeginner · 4 min
Role packages tasks handlers defaults and templates.
- Jinja2 templateBeginner · 4 min
Jinja2 template renders variable-driven configuration files.
- VaultBeginner · 4 min
Vault encrypts secrets stored with Ansible.
- TagsBeginner · 4 min
Tags limit task execution to selected subsets.
- Serial rolling updatesBeginner · 5 min
Serial rolling updates limits batch size across hosts.
- Delegate_toBeginner · 5 min
Delegate_to runs a task on a different machine.
- Async tasksBeginner · 4 min
Async tasks start long-running remote operations.
- 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.
- 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…
- 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.
- 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.
- 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…
- 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…
- 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…
- 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…
- 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…
- 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…
- 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…
- 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…
- 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…
- 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…
- 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…
- 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.
- 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…
- 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…
- 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.
- 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.
- 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.
- 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.
- 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…
- 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…
- 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.