Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Drift Detection · Drift Management

Direct answer

Drift detection in drift management runs scheduled comparisons — terraform plan, Ansible check mode, GitOps diff, config backups compared in Git — and flags any differences.

When to use this

Use this when scheduling comparisons between actual and desired state.

First 30 seconds

1. Drift detection on schedule or continuously.

2. Check mode, refresh-only plans, GitOps status, compliance scans.

3. Alert on important drift.

4. Low noise.

5. Store results.

Operational verification

schedule → compare → drift findings

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
desired/actual state drift management
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformdesired/actual state drift management · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when scheduling comparisons between actual and desired state.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

4 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verify drift detection with a controlled field change and restored no-drift state Verify boundary

Verify Drift Detection in a safe target by capturing a known no-drift baseline with result No drift for one object, making one controlled reversible field change and expecting exactly that field to appear as drift with the correct desired and actual values. Restore the desired value, collect fresh actual state, repeat the drift scan and expect result Success with the diff cleared. Confirm the report records desired revision and observation time. A clear drift report shows the comparator saw no difference in covered fields, but it does not show uncollected state is compliant.

Step 2 Verification path Verify boundary

The negative fixture should deliberately exercise risks such as stale actual state, noisy computed fields, wrong identity match, over-broad ignore rules, concurrent changes and remediation creating new drift, choosing the cases most relevant to scheduled/event-driven desired-versus-actual reads, normalized diff, ignored fields, freshness and creating a reviewable drift record before remediation.

Step 3 Branch drift faults at desired revision, observation, normalization and comparison policy Narrow the fault

If Drift Detection reports an unexpected difference, verify it loaded the intended desired revision and the same target identity before changing anything. If desired state is correct, inspect the raw observed value and observation timestamp. If raw values are equivalent but the diff remains, inspect normalization, defaults and ignored/computed fields. If drift disappears intermittently, compare collection consistency and eventual convergence. Reproduce one field diff from raw desired and actual values through the comparator.

Step 4 Common mistakes Narrow the fault
  • Detection intervals too long.
Evidence references

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.

observation · 1
Key points
  • Use terraform plan, check mode or GitOps diff to detect drift.
  • Run detection on a schedule.
  • Alert when drift is found.
Key checks
  • ansible-playbook site.yml --check --diff — CM drift
  • terraform plan -refresh-only — IaC drift
  • argocd app list | grep OutOfSync — GitOps drift
ReferenceWhy it matters1 section · depth on demand

Drift detection compares normalized desired state with independently observed actual state

Drift Detection requires two trustworthy inputs: desired state from an authoritative revision and actual state collected from the managed system. The detector owns the comparison process and depends on both desired-state and observation providers. Normalization matters because ordering, defaults and computed values can create false differences. The detector owns comparison logic, not the source systems. Record desired revision, observation timestamp, object identity and normalization rules so a reported diff can be reproduced. A zero-drift result is only as strong as the observation coverage and freshness.

ReferenceImportant terms & boundaries1 section · depth on demand

Method

Drift detection compares actual and desired state automatically and reports differences.

1. Choose the method per platform: ansible --check --diff, terraform plan -detailed-exitcode, config diff tools, DSC Test-DscConfiguration.

2. Schedule it (daily or more often for critical systems).

3. Filter known volatile differences.

4. Report results to owners and track counts over time.

5. Treat detection failures (unreachable targets) as findings too.

terraform plan -detailed-exitcode -no-color > plan.txt; rc=$?
# 0 = no drift, 2 = drift, 1 = error
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docdesired/actual state drift management current

Authoritative/upstream documentation reviewed for bounded claims in Drift Management > Drift Detection. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://developer.hashicorp.com/terraform/tutorials/state/resource-drift · confidence 94%
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

For scheduled/event-driven desired-versus-actual reads, normalized diff, ignored fields, freshness and creating a reviewable drift record before remediation, prefer typed fields and stable IDs over human presentation text.

Confirmation

Confirm action

Continue?