Level 1 · Ansible Foundations¶
Level 1 builds the working model: how Ansible reaches hosts, how an inventory and a playbook describe them and their desired state, what idempotency means in practice, and how to read what happened. Every playbook shown with output was run with the real ansible-playbook.
What was run, and what wasn't
ansible-core 2.21.5 on a Mac, with all "servers" using ansible_connection=local and acting on sandbox directories. Not exercised: SSH, become, Linux packages and services, Windows and network targets, and automation controllers. Those are labelled "not run" where they come up, and drawn from docs.ansible.com as read in October 2026.
Modules¶
- What Ansible Is and How It Works: agentless push, the model, and the comparison with scripts, Terraform and agent-based tools.
- Ad-Hoc Commands, Modules and ansible-doc: one module, many hosts; why
commandalways says changed. - Inventory: INI and YAML, groups, patterns, variable merging; a pattern that matches nothing exits 0.
- Playbook Anatomy: plays, tasks, run order, and a YAML mistake that broke a real task.
- Idempotency, Changed and Check Mode: the second-run recap,
creates, check and diff. - Variables and Facts: sources,
set_fact,-ebeating everything, facts and magic variables. - Conditionals, Loops and Register: and a boolean-string error in ansible-core 2.21.5.
- Templates and Handlers: handlers fire once; a failure can leave a stale service.
- Debugging and Reading Failures: error anatomy, verbosity,
assert,--start-at-taskpitfalls. - Project: A Verified Baseline Playbook: 8 tests that run real Ansible.
After Level 1¶
Level 2 adds structure and safety: roles, a measured variable-precedence table, Jinja2 filters, error handling, Vault with real encryption, collections, tags and limits, delegation and serial batches, linting and testing, and a tested role.