2. Your first convergence
Run the check → apply → re-check loop and watch idempotence do its thing.
After this lesson you can
- Preview a play's status with check (report-only) - Converge the machine with apply - Prove idempotence with a second run
Before you start: Install and scaffold a playbook
The same playbook drives both modes. check runs every step's check() read-only and reports its status — nothing on the machine changes. apply runs apply() for each unconfigured step, then re-checks it in the same run: convergence is proven, not assumed.
Idempotence is the contract's payoff: after a successful apply, every later run — check or apply, even in a fresh process — must report already configured and change nothing.
§ 1Exercise: check, apply, re-check
Dry-run the scaffolded play, converge it, then prove a second apply is a no-op.
Expected result
The first check reports the steps not configured; the first apply reports them configured; the second apply reports every step already configured and exits 0.
Hint
A step that flips back to not configured on the re-run has a broken resource script — its apply() doesn't produce the state its check() looks for.