Automation
Drift Management
Cheat sheet · https://pcornel.dk/topic.php?topic=6004
Answer
Drift management compares the actual state of systems with the desired state in code, reports differences and fixes them automatically or manually, keeping configuration consistent over time.
Remember
- Drift comes from manual changes, failed runs or other tools.
- Detect first, then decide: fix the system or update the code.
- Report drift trends to find root causes.
First checks
- Drift reports per system — visibility
- Remediation policy (auto vs manual) — decision
- Drift sources analysis — prevention
Verify in this order
desired vs actual → drift → report → remediate → prevent
Where it usually breaks
Automation/controller success is not target-state proof; target config/state is not effective-runtime proof; effective state is not workload proof.
→ Drift Management · operational reference
| Layer | Drift Management operational reference |
|---|---|
| Runtime/ownership | Terraform / declarative automation current · identify controller/worker/target ownership before mutation |
| Persistent intent | Versioned configuration/playbook/workflow with explicit dependencies and least-privilege identity |
| Verification | terraform plan -refresh-only -detailed-exitcode; terraform plan -detailed-exitcode |
| Expected interpretation | The workflow distinguishes actual remote state from recorded state and desired configuration, classifies authorized vs unauthorized divergence, and chooses adopt/reconcile/ignore deliberately. |
| Recovery boundary | Preserve correlation IDs + pre-state, then verify target/service independently after remediation |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6004