Use it when configuring, checking or troubleshooting Current State in Automation Fundamentals.
Current State
Current State is the observed condition of managed targets at a specific time and scope, used to decide what automation should do next.
1. Current state is what actually exists now.
2. Gather facts/refresh before deciding.
3. Compare with desired state.
4. Don't trust cached state blindly.
5. Record evidence.
target → facts/refresh → current state
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Focused checks for this Topic. Stored verification and troubleshooting material remains available below.
Check 1 — Identify the authoritative observation
Record the source/API/provider, resource identity, environment, scope, collection time and authority for the observed current state. Controller/cache state may not represent the live resource.
Check 2 — Verify freshness and normalize before comparison
Check timestamps, eventual consistency and query scope; normalize provider defaults and insignificant representation differences before comparing fields. Stale or partial observations are not proof of drift.
Check 3 — Compare current state to desired state
Treat desired state as intent and current state as an observation. Identify the exact differing field and owner, then distinguish meaningful drift from unobserved or pending changes.
Check 4 — Check actual convergence and consumer impact
After a controlled change, independently read the authoritative target again and repeat the original workload check. A successful API write or controller plan alone does not establish convergence.
More detailAdditional checks3 sections
Longer notes behind the focused checks above. Start with the checks; use these when you need more detail.
Operational evidence path
target/source → state observation → freshness/authority check → normalization → desired-state comparison → action decision → post-change re-observation
Healthy evidence: state is freshly observed from an appropriate source, normalized consistently and correlated with runtime/service evidence where required.
Failure modes and next checks
Suspicious evidence: stale cache, controller/target disagreement, missing fields, default-value ambiguity, inventory drift or actions based on assumptions instead of observation.
Common mistakes
- Reading current state from a stale cache.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Observe before changing
This Ansible playbook reads the current service state and compares it with the desired condition. It does not change the service. Assumes an inventory group named web and a systemd service named nginx.service.
- name: Read observed service state (no configuration change)
hosts: web
gather_facts: false
tasks:
- name: Read service facts
ansible.builtin.service_facts:
- name: Compare observation with desired state
ansible.builtin.assert:
that:
- ansible_facts.services['nginx.service'].state == 'running'
fail_msg: nginx is not observed running
A passing assertion proves only that the queried service reported running during this read. It does not prove application reachability or that later state remains unchanged. This is an illustrative example, not observed production evidence.
- 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.
ansible -m setup <host>— facts (current state)terraform plan -refresh-only— real-world statekubectl get <obj> -o yaml | yq .status— observed status
ReferenceWhat it is1 section · depth on demand
Core model
Collect state from authoritative target APIs, facts or telemetry, normalize it into the comparison model, record freshness and uncertainty, then compare it with desired state before acting.
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
Observed current state shows what the selected source reported at that time, but it does not show freshness, completeness or desired correctness unless those boundaries are separately validated.
In depth
Current state is what a system actually looks like right now: its running configuration, installed packages, interface status or cloud resources. Automation reads it first so it can decide what needs to change and later verify the result.
| Source of current state | Example |
|---|---|
| Device/API query | show running-config, RESTCONF GET |
| Facts gathering | Ansible gather_facts, service_facts |
| Tool state file | Terraform state (last known, may be stale) |
| Telemetry | Streaming operational data |
Treat stored state as a cache: Terraform state or a CMDB can disagree with reality after manual changes, so refresh or query the live system before relying on it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Automation Fundamentals > Current State. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/azure/well-architected/operational-excellence/enable-automation · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Current State automation boundary map
Fast intent, state, execution, verification and recovery boundaries for Current State.
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Intent / inputs | Owner, scope and authoritative inputs are explicit and versioned where applicable | Hidden defaults, stale inventory or competing sources of truth |
| Decision / execution | Plan or decision is explainable and actions are bounded per target | Blind fan-out, implicit assumptions or success based only on executor status |
| State / verification | Target is re-observed and acceptance criteria prove the intended outcome | No read-back, perpetual drift, partial side effects or unresolved exceptions |
| Recovery / evidence | Retry, rollback or escalation behavior is defined and auditable | Unknown partial completion, unsafe retry or evidence lost during remediation |