Pcornel
Automation · Automation Fundamentals

Current State

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

Back to the Topic

Answer

Current State is the observed condition of managed targets at a specific time and scope, used to decide what automation should do next.

Remember

  • Current state ≠ desired state; observation reports what is, not what should be.
  • Cached state ≠ current state automatically; freshness and invalidation matter.
  • Controller state ≠ target state if synchronization can lag or fail.
  • Observed configuration ≠ full runtime health; service state and dependent systems may require separate checks.

First checks

  • ansible -m setup <host> — facts (current state)
  • terraform plan -refresh-only — real-world state
  • kubectl get <obj> -o yaml | yq .status — observed status

Commands

show running-config

Verify in this order

target → facts/refresh → current state

Where it usually breaks

Observed current state proves what the selected source reported at that time; it does not prove freshness, completeness or desired correctness unless those boundaries are separately validated.

Configuration/input → graph/state refresh → plan → provider API request → provider terminal result → resource read-back → effective service state → workload.

Current State automation boundary map

BoundaryHealthy evidenceSuspicious evidence
Intent / inputsOwner, scope and authoritative inputs are explicit and versioned where applicableHidden defaults, stale inventory or competing sources of truth
Decision / executionPlan or decision is explainable and actions are bounded per targetBlind fan-out, implicit assumptions or success based only on executor status
State / verificationTarget is re-observed and acceptance criteria prove the intended outcomeNo read-back, perpetual drift, partial side effects or unresolved exceptions
Recovery / evidenceRetry, rollback or escalation behavior is defined and auditableUnknown partial completion, unsafe retry or evidence lost during remediation

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

Confirmation

Confirm action

Continue?