Use this when systems differ from their managed definition.
Drift · Configuration Management
Drift is when a system's actual configuration no longer matches the managed definition, usually because of manual changes, failed runs or other tools changing the same settings.
1. Drift: actual state diverges from desired (manual changes, other tools, updates).
2. Detect regularly.
3. Correct or codify.
4. Find the source.
5. Avoid tool overlap.
desired vs actual → drift
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
Record definition revision, inventory target ID, resource/task identity and execution/run ID; inspect the runtime/control-plane result; then query the managed host/service/file/package configuration and its consumer-visible behavior through an independent read path and compare it with the versioned intent. The negative fixture should deliberately exercise risks such as inventory drift, variable precedence surprises, template rendering errors, non-idempotent modules, partial convergence and green task status with unhealthy service, choosing the cases most relevant to desired-versus-actual comparison, normalization, ignored/computed fields, drift ownership and safe convergence rather than blind Set/reapply. For Configuration Management → Drift, the evidence must connect the control-plane result to the managed host/service/file/package configuration and its consumer-visible behavior and explain any gap between desired, controller-reported and consumer-visible state.
Step 2 Common mistakes Narrow the fault
- Accepting drift as normal.
Step 3 Where it fails Narrow the fault
Failure analysis for Configuration Management → Drift should follow the path through the components: source/inventory → variable/template resolution → module/resource evaluation → target mutation → convergence result → service/application read-back. Common failure classes include inventory drift, variable precedence surprises, template rendering errors, non-idempotent modules, partial convergence and green task status with unhealthy service. Before retrying a mutating operation, read current target state using the stable identity definition revision, inventory target ID, resource/task identity and execution/run ID; if state is unknown, stop broad retries.
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.
- Drift is the difference between managed definition and reality.
- Manual changes and failed runs cause it.
- Decide whether the system or the code is right.
ansible-playbook site.yml --check --diff | grep -c changed— drift countaide --check— file drift- Last manual login/change audit — causes
ReferenceWhy it matters1 section · depth on demand
In depth
Drift is the difference between a system's actual configuration and its desired configuration, usually caused by manual changes, partial deployments or another tool changing the same settings. Drift makes systems inconsistent and future automation unpredictable.
| Drift source | Example |
|---|---|
| Manual hotfix | Admin changes an ACL during an incident |
| Failed run | Half the hosts updated |
| Competing tools | GPO and Ansible both manage a setting |
| Vendor updates | Upgrade changes defaults |
Decide per setting whether drift should be reverted automatically, reported for review, or accepted and written back into the desired state.
ReferenceImportant terms & boundaries1 section · depth on demand
Mechanics
Configuration Management → Drift is owned at runtime by the configuration-management controller/engine and per-target modules/resources converging declared state. Its durable intent is versioned desired-state definitions, inventory, variables, templates/modules and enforcement policy; the stable identity contract is definition revision, inventory target ID, resource/task identity and execution/run ID. The consumer-visible target is the managed host/service/file/package configuration and its consumer-visible behavior. The operating invariants are that desired state and target selection are explicit, repeated runs converge/no-op, variable precedence is reviewable, changes are reported and post-state is independently checked. Follow the chain of components source/inventory → variable/template resolution → module/resource evaluation → target mutation → convergence result → service/application read-back and record which layer currently owns truth. The linked authority for bounded mechanics is Ansible Documentation — Playbooks; documentation support is separate from observed lab/production Evidence.
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 Configuration Management > Drift. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_intro.html · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
Capture at minimum definition revision, inventory host/object, task/resource, resolved variables, changed/no-op status, diff/error and final target/service state. For desired-versus-actual comparison, normalization, ignored/computed fields, drift ownership and safe convergence rather than blind Set/reapply, prefer typed fields and stable IDs over human presentation text.