Ansible
Cheat sheet · https://pcornel.dk/topic.php?topic=786
Answer
Ansible is an automation engine that evaluates inventory, variables and playbook content on a control node, then performs ordered actions against selected managed nodes or delegated targets without requiring a persistent Ansible agent on those targets.
Remember
- Playbook completed ≠ service healthy; task results prove Ansible execution boundaries, not every application acceptance condition.
- changed=0 ≠ desired state proven; a task can be skipped, mis-targeted, use stale inputs or check an incomplete condition.
- Inventory membership ≠ host reachable or authorized; selection and transport/authentication are separate boundaries.
- Agentless ≠ dependency-free; the control node, transport, target interpreter/runtime and module prerequisites can still matter.
First checks
ansible --version— versions and config fileansible-lint— lintansible-playbook site.yml --check --diff— preview
Commands
ansible --version- Show the Ansible version, Python interpreter and configuration file in use.
ansible all -m ping- Test SSH connectivity and Python availability on every inventory host with the ping module.
Verify in this order
playbook → inventory → modules over SSH/WinRM → hosts
Where it usually breaks
A successful Ansible run proves the selected automation path completed according to Ansible result semantics; it does not independently prove every target workload, dependency or business acceptance condition.
Automation/controller success is not target-state proof; target config/state is not effective-runtime proof; effective state is not workload proof.
Ansible / Network Automation evidence chain
| Boundary | Question | Evidence | Does not prove |
|---|---|---|---|
| Definition | What is configured or intended? | running configuration / controller policy | live operation |
| Local state | Is the feature active at the expected scope? | ansible-inventory --list | remote success |
| Counters | Did controlled traffic or an event reach this stage? | scoped counters/timestamps | complete return path |
| Next boundary | What consumes or transports this state? | inventory/variables → connection plugin → module intent → candidate diff → limited execution → assertion → audit/rollback | application success |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=786