Skip to content

feat: bash units run by mise (parallel, failure-isolated), with omp and its auth-broker client as the first unit - #331

Closed
hanthor wants to merge 7 commits into
masterfrom
feat/omp-auth-broker-client
Closed

hanthor wants to merge 7 commits into
masterfrom
feat/omp-auth-broker-client

Conversation

@hanthor

@hanthor hanthor commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Why

On himachal the Ansible omp role aborted at Deploy omp-kiro-provider config (/home/james/.config/omp does not exist), so the routing merge, omp-route and the auth-broker config never ran and ~/.omp/agent/config.yml stayed empty. Ansible aborts a whole role on one failed task.

What

  • Bash units (units/*.sh): idempotent, never set -e; a failing step is recorded and the later independent steps still run. units/lib.sh has step/soft/note/finish/install_if_changed/bw_session.
  • mise runs them (mise.toml, one task per unit, parallel, --continue-on-error). scripts/run-units.sh [--no-secrets] [--tags a,b] is the single wrapper; without mise it falls back to running units sequentially so Termux/musl hosts keep updating.
  • omp is the first unit (units/omp.sh), including the auth-broker client config (URL in units/omp/auth-broker.conf, token from Bitwarden when unlocked). roles/omp is removed.
  • just apply, apply-nosecrets, apply-tags, dotfiles run the wrapper after Ansible and combine exit codes; just units runs it directly. mise added to core_brews and just doctor.
  • All other roles stay on Ansible.

units/, mise.toml and scripts/run-units.sh are intentionally not carved out of CODEOWNERS (the fleet timer executes them).

Tests

tests/test_omp_unit.py (fresh-HOME regression, idempotency, failure isolation) and tests/test_units_registry.py (mise.toml / units/ / ALL_UNITS / tag map stay consistent).

The omp role installed omp but never pointed it at the fleet's auth broker
(`omp auth-broker`, running on punjab), so a rebuilt machine had an empty
~/.omp/agent/config.yml and no provider credentials until someone ran
/login by hand.

The role now sets auth.broker.url from group_vars and, when Bitwarden is
unlocked, writes auth.broker.token from the item omp-auth-broker-token. A
locked vault leaves an existing token alone. The config file is set to 0600
and the role reports `omp auth-broker status`.

just seed-omp-broker (run on punjab) creates the Bitwarden item from
`omp auth-broker token`, which prints the token without rotating it.

The broker's own systemd unit on punjab is still hand-made and unmanaged.
@hanthor hanthor changed the title feat(omp): configure the omp auth broker client on every host feat: bash units run by mise (parallel, failure-isolated), with omp and its auth-broker client as the first unit Oct 25, 2026
hanthor and others added 2 commits October 27, 2026 17:56
Read the broker token over Tailscale SSH when seeding Bitwarden, and preserve the vault when the server is unreachable.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: James Reilly <5840441+hanthor@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: James Reilly <5840441+hanthor@users.noreply.github.com>
hanthor and others added 3 commits October 27, 2026 18:11
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: James Reilly <5840441+hanthor@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: James Reilly <5840441+hanthor@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: James Reilly <5840441+hanthor@users.noreply.github.com>
@hanthor

hanthor commented Nov 18, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #348: every commit in this PR is also in #348 (refactor: migrate fleet configuration to native units).

Closed during the 2026-11-18 cleanup. The branch is kept, so this can be reopened.

@hanthor hanthor closed this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant