Pcornel
Automation

Ansible

Cheat sheet · https://pcornel.dk/topic.php?topic=786

Back to the Topic

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 file
  • ansible-lint — lint
  • ansible-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

BoundaryQuestionEvidenceDoes not prove
DefinitionWhat is configured or intended?running configuration / controller policylive operation
Local stateIs the feature active at the expected scope?ansible-inventory --listremote success
CountersDid controlled traffic or an event reach this stage?scoped counters/timestampscomplete return path
Next boundaryWhat consumes or transports this state?inventory/variables → connection plugin → module intent → candidate diff → limited execution → assertion → audit/rollbackapplication success

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=786

Confirmation

Confirm action

Continue?