Pcornel
Automation · Configuration Management

Drift Detection

Cheat sheet · https://pcornel.dk/topic.php?topic=5380

Back to the Topic

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

LayerConfiguration Management → Drift Detection operational reference
Context identityAnsible latest/current + exact revision/input/target identity
Persistent intentVersioned contract/configuration with explicit ownership and prerequisites
VerificationValidate inputs/read current state → exercise bounded operation → independent target read-back
Output contractPreserve structured status/IDs/properties before human formatting
Failure boundarySeparate 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

Confirmation

Confirm action

Continue?