Pcornel
Automation · Automation Design

Variables

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

Back to the Topic

Answer

Variables hold values used throughout automation, such as host addresses or package versions, defined at the right scope (global, group, host, run) so they can change without editing logic.

Remember

  • Variables should be defined at the narrowest sensible scope.
  • Know the tool's precedence order.
  • Secrets belong in a vault, not plain variables.

First checks

  • ansible-inventory --host <host> — effective variables
  • Variable precedence rules — where values come from
  • Naming conventions — clarity

Verify in this order

defaults → group/host vars → extra vars → effective value

Where it usually breaks

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

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

Confirmation

Confirm action

Continue?