Automation · Configuration Management
Drift Detection
Cheat sheet · https://pcornel.dk/topic.php?topic=5380
Answer
Drift detection in configuration management runs the tool in check mode or compares facts with the desired state on a schedule, reporting resources that would change.
Remember
- Detect drift by running the tool in check mode or comparing facts.
- Schedule detection regularly.
- Report results to owners.
First checks
ansible-playbook site.yml --check --diff— scheduled drift scan- Drift report in CI/AWX schedule — automation
- Alert on drift — notification
Verify in this order
schedule → check run → drift report → alert
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Configuration Management → Drift Detection · operational reference
| Layer | Configuration Management → Drift Detection operational reference |
|---|---|
| Context identity | Ansible latest/current + exact revision/input/target identity |
| Persistent intent | Versioned contract/configuration with explicit ownership and prerequisites |
| Verification | Validate inputs/read current state → exercise bounded operation → independent target read-back |
| Output contract | Preserve structured status/IDs/properties before human formatting |
| Failure boundary | Separate source/input/engine/controller execution from downstream target outcome |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5380