Pcornel
Automation · Idempotency

Desired State

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

Back to the Topic

Answer

Desired state in idempotency is the target description the operation compares against, such as 'package present at version 1.2', so it knows whether any change is needed.

Remember

  • Desired state defines the target.
  • Compare before acting.
  • Report differences.

First checks

  • Desired state defined explicitly — input
  • Single source for desired state — authority
  • Comparison logic — diff

Verify in this order

desired state → comparison → actions

Where it usually breaks

Configuration/input → graph/state refresh → plan → provider API request → provider terminal result → resource read-back → effective service state → workload.

Idempotency → Desired State · operational reference

LayerIdempotency → Desired State operational reference
Context identityDeclarative configuration management / Puppet 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=5997

Confirmation

Confirm action

Continue?