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
Owner

Summary

  • Fixed trailing newline mismatch in config comparison (ansible command module strips whitespace, slurp preserves it)
  • Only copy temp file when config actually needs updating (avoids spurious changes)
  • Task now properly skips when config is already correct

Deployment and Testing

  • Verified idempotency: changed=0 on repeated runs
  • Verified change detection: corrupted config triggers proper update
  • ansible-lint passes

🤖 Generated with Claude Code

## Summary - Fixed trailing newline mismatch in config comparison (ansible command module strips whitespace, slurp preserves it) - Only copy temp file when config actually needs updating (avoids spurious changes) - Task now properly skips when config is already correct ## Deployment and Testing - [x] Verified idempotency: `changed=0` on repeated runs - [x] Verified change detection: corrupted config triggers proper update - [x] ansible-lint passes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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>
eblume merged commit f2541c3f77 into main 2026-01-19 16:19:53 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
eblume/blumeops!31
No description provided.