Fix minikube role idempotency for zot mirror config #31

Merged
eblume merged 1 commit from fix-minikube-idempotency into main 2026-01-19 16:19:53 -08:00

1 commit

Author SHA1 Message Date
da14d4759f Fix minikube role idempotency for zot mirror config
The role was reporting "changed" on every run due to:
1. Trailing newline mismatch: ansible command module strips trailing
   whitespace from stdout, but slurp preserves it in base64 decode
2. Temp file always copied then deleted, causing spurious changes

Fix by:
- Reading desired config directly from role files (delegate_to: localhost)
- Comparing with `| trim` on both sides to normalize whitespace
- Only copying temp file when config actually needs updating
- Task now only runs when config differs, so changed_when: true is correct

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 16:17:57 -08:00