ansible-freshen check mode aborts on tap+formula migrations #229

Closed
opened 2026-06-05 18:32:11 +00:00 by coilysiren · 1 comment
Owner

Problem

coily exec ansible-freshen (default check mode, --check --diff) hard-fails whenever the declared baseline adds a new Homebrew tap and a formula from that tap in the same run.

In check mode the tap task reports changed but does not actually tap, so the subsequent homebrew : Ensure Homebrew formulae are present task can't resolve the formula and the play aborts:

TASK [homebrew : Ensure Homebrew taps are present]
changed: [localhost] => (item={'name': 'coilyco-bridge/coily', ...})

TASK [homebrew : Ensure Homebrew formulae are present]
[ERROR]: No available formula or cask with the name "coilyco-bridge/coily/coily".
This command requires the tap coilyco-bridge/coily.
fatal: [localhost]: FAILED!

This surfaced during the coily org migration (coilysiren/coily -> coilyco-bridge/coily). The migration itself converged fine via action=apply tags=homebrew + a manual reinstall/untap, but it means check mode is unusable as a preview for any future tap+formula migration. The whole point of the default check run is to print the plan without mutating, and right now it errors out instead.

Suggested fix

In ansible/roles/homebrew/tasks/main.yml, make the formulae assertion tolerant of a not-yet-present tap under check mode. Options:

  • Skip / soft-fail the formula task for formulae whose owning tap is itself changed in this run (when ansible_check_mode).
  • Or register the tap task result and when: the formula items off it.

Goal: in check mode, a tap+formula migration should print as "would tap + would install" rather than aborting the play.

Repro

cd ~/projects/coilyco-flight-deck/infrastructure
coily exec ansible-freshen tags=homebrew   # with a declared tap that isn't yet present locally

Found while running the freshness sweep on kais-macbook-pro on 2026-06-05.

## Problem `coily exec ansible-freshen` (default check mode, `--check --diff`) hard-fails whenever the declared baseline adds a new Homebrew **tap** and a **formula from that tap** in the same run. In check mode the tap task reports `changed` but does **not** actually tap, so the subsequent `homebrew : Ensure Homebrew formulae are present` task can't resolve the formula and the play aborts: ``` TASK [homebrew : Ensure Homebrew taps are present] changed: [localhost] => (item={'name': 'coilyco-bridge/coily', ...}) TASK [homebrew : Ensure Homebrew formulae are present] [ERROR]: No available formula or cask with the name "coilyco-bridge/coily/coily". This command requires the tap coilyco-bridge/coily. fatal: [localhost]: FAILED! ``` This surfaced during the coily org migration (`coilysiren/coily` -> `coilyco-bridge/coily`). The migration itself converged fine via `action=apply tags=homebrew` + a manual reinstall/untap, but it means **check mode is unusable** as a preview for any future tap+formula migration. The whole point of the default check run is to print the plan without mutating, and right now it errors out instead. ## Suggested fix In `ansible/roles/homebrew/tasks/main.yml`, make the formulae assertion tolerant of a not-yet-present tap under check mode. Options: - Skip / soft-fail the formula task for formulae whose owning tap is itself `changed` in this run (when `ansible_check_mode`). - Or register the tap task result and `when:` the formula items off it. Goal: in check mode, a tap+formula migration should print as "would tap + would install" rather than aborting the play. ## Repro ``` cd ~/projects/coilyco-flight-deck/infrastructure coily exec ansible-freshen tags=homebrew # with a declared tap that isn't yet present locally ``` Found while running the freshness sweep on kais-macbook-pro on 2026-06-05.
Member

Closed in the 2026-08-26 backlog burn-down (coilyco-bridge/agentic-os-kai#901).

Verified as already landed: Closing: the check-mode abort is fixed. The tap task in ansible/roles/homebrew/tasks/main.yml carries check_mode: false so taps are really added under --check and the following tap-qualified formula lookup resolves, documented at docs/ansible-homebrew.md:8. Landed against the sibling report #243.

This issue was open only because nothing closed it when the work shipped. If the verification is wrong, reopen it. The whole set is recoverable with state:closed label:burndown-2026-08.

Closed in the 2026-08-26 backlog burn-down (coilyco-bridge/agentic-os-kai#901). Verified as already landed: Closing: the check-mode abort is fixed. The tap task in ansible/roles/homebrew/tasks/main.yml carries `check_mode: false` so taps are really added under --check and the following tap-qualified formula lookup resolves, documented at docs/ansible-homebrew.md:8. Landed against the sibling report #243. This issue was open only because nothing closed it when the work shipped. If the verification is wrong, reopen it. The whole set is recoverable with `state:closed label:burndown-2026-08`.
coilyco-ops 2026-08-27 03:09:28 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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
coilyco-flight-deck/infrastructure#229
No description provided.