Pcornel
Automation · Automation Troubleshooting

Variable Problems

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

Back to the Topic

Answer

Variable Problems isolates wrong, missing, shadowed or unexpectedly coerced values by tracing variable definition, precedence, scope, defaults and runtime expansion to the effective value used by an operation.

Remember

  • Variable defined ≠ intended definition won precedence.
  • Empty string ≠ undefined ≠ null ≠ false.
  • Displayed variable ≠ same value used later after mutation/override.
  • Correct global value ≠ per-target override is correct.

First checks

  • ansible-inventory --host <h> | jq . — effective vars
  • ansible <h> -m debug -a 'var=<v>' — value
  • Precedence/override location — source

Verify in this order

sources → precedence → effective value

Where it usually breaks

Variable inspection proves a value at one evaluation boundary; later overrides, lazy evaluation or target-specific scope can still change behavior.

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

Variable Problems troubleshooting proof-boundary map

BoundaryHealthy evidenceSuspicious evidence
Symptom / scopeTime window, immutable source/run identity, effective inputs and exact targets are explicitFloating source, changed inputs or ambiguous targets destroy reproducibility
First failed boundaryTransport/auth/dependency/render/operation evidence identifies the earliest divergenceInvestigation starts at the final error and skips earlier unproven boundaries
Effective outcomeController result is paired with target read-back and workload/service acceptanceGreen execution state or changed symptom substitutes for effective-state verification
Recovery / closureMinimal change restores the original test and regression/partial-state checks are cleanBroad retry or unrelated edits make the incident non-reproducible and hide residual state

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

Confirmation

Confirm action

Continue?