Variable Problems
Cheat sheet · https://pcornel.dk/topic.php?topic=6058
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 varsansible <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
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Symptom / scope | Time window, immutable source/run identity, effective inputs and exact targets are explicit | Floating source, changed inputs or ambiguous targets destroy reproducibility |
| First failed boundary | Transport/auth/dependency/render/operation evidence identifies the earliest divergence | Investigation starts at the final error and skips earlier unproven boundaries |
| Effective outcome | Controller result is paired with target read-back and workload/service acceptance | Green execution state or changed symptom substitutes for effective-state verification |
| Recovery / closure | Minimal change restores the original test and regression/partial-state checks are clean | Broad 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