coa phase 3: coa_shared role on matou + build/tenant env on the coa role (plan Tasks 16–17) #10

Merged
ben merged 1 commit from coa-phase-3 into main 2026-09-01 00:54:29 +00:00
Owner

Two session tickets from the coa phase-3 plan (spec §3.6, ADR 0005):

#6 — roles/coa_shared (pattern: matou_forms / coa). Pinned checkout of Matou/matou-infrastructure at /opt/coa-shared/src, any-sync/config.env rendered for coa mode with external addresses (coa-infra.<domain>, vault MinIO keys), keri/.env.coa via generate-env.sh coa with CONFIG_PUBLIC_URL, keri/.env.secrets with CONFIG_ADMIN_TOKEN from vault coa_config_admin_token, make up-coa, wait/probe 127.0.0.1:5904, ufw tcp 5901–5903 / 7642–7647 / 9723 / 3001–3006 + udp 3011–3016, Caddy coa-infra.<domain> → 127.0.0.1:5904. Wired in playbooks/host.yml after coa (coa_shared_enabled, tags coa_shared, routing); host_vars/matou.yml enables it and pins coa_shared_infra_ref; secrets.yml.example gains the COA block.

#7 — coa role phase-3 env. Compose gains GITHUB_DISPATCH_TOKEN, COA_BUILDS_REPO/WORKFLOW/REF, BUILD_WEBHOOK_SECRET, COA_NOTIFY_EMAIL, COA_SHARED_ADMIN_URL (http://127.0.0.1:5904), COA_SHARED_ADMIN_TOKEN, COA_SHARED_PUBLIC_URL; defaults coa_builds_repo, coa_notify_email, …; the assert requires coa_github_dispatch_token, coa_webhook_hmac_secret, coa_config_admin_token.

Two things the ticket text didn't know:

  • The Forgejo copy of matou-infrastructure is private; the role clones the public GitLab remote (matou-collective/matou-infrastructure, the repo's real origin) anonymously instead of putting a credential on the host. Consequence: a pinned sha must be on GitLab — mirror main there after merging a Forgejo PR (coa GOTCHAS 12 applies to this repo too).
  • The pin ff581b7c is the tip of matou-infrastructure PR #6 (infra #3–#5), pushed to both remotes. It stays valid once that PR merges; bump to the merge sha later if you prefer.

Acceptance: ansible-playbook playbooks/host.yml --limit matou --check --diff -t coa_shared → ok=12 changed=8 failed=0 (git pin resolves, config/secrets/Caddy render; the run-only make up-coa/wait/probe tasks are gated on not ansible_check_mode because chdir fires before check mode is honoured); -t coa → ok=13 changed=2 failed=0, the new env renders from the vault values into the 0600 compose. Real runs are coa Task 18b/19.

Closes #6
Closes #7

Two session tickets from the coa phase-3 plan (spec §3.6, ADR 0005): **#6 — `roles/coa_shared`** (pattern: `matou_forms` / `coa`). Pinned checkout of Matou/matou-infrastructure at `/opt/coa-shared/src`, `any-sync/config.env` rendered for `coa` mode with external addresses (`coa-infra.<domain>`, vault MinIO keys), `keri/.env.coa` via `generate-env.sh coa` with `CONFIG_PUBLIC_URL`, `keri/.env.secrets` with `CONFIG_ADMIN_TOKEN` from vault `coa_config_admin_token`, `make up-coa`, wait/probe `127.0.0.1:5904`, ufw tcp 5901–5903 / 7642–7647 / 9723 / 3001–3006 + udp 3011–3016, Caddy `coa-infra.<domain>` → `127.0.0.1:5904`. Wired in `playbooks/host.yml` after `coa` (`coa_shared_enabled`, tags `coa_shared, routing`); `host_vars/matou.yml` enables it and pins `coa_shared_infra_ref`; `secrets.yml.example` gains the COA block. **#7 — `coa` role phase-3 env.** Compose gains `GITHUB_DISPATCH_TOKEN`, `COA_BUILDS_REPO/WORKFLOW/REF`, `BUILD_WEBHOOK_SECRET`, `COA_NOTIFY_EMAIL`, `COA_SHARED_ADMIN_URL` (`http://127.0.0.1:5904`), `COA_SHARED_ADMIN_TOKEN`, `COA_SHARED_PUBLIC_URL`; defaults `coa_builds_repo`, `coa_notify_email`, …; the assert requires `coa_github_dispatch_token`, `coa_webhook_hmac_secret`, `coa_config_admin_token`. **Two things the ticket text didn't know:** - The Forgejo copy of matou-infrastructure is **private**; the role clones the **public GitLab** remote (`matou-collective/matou-infrastructure`, the repo's real `origin`) anonymously instead of putting a credential on the host. Consequence: a pinned sha must be on GitLab — mirror `main` there after merging a Forgejo PR (coa GOTCHAS 12 applies to this repo too). - The pin `ff581b7c` is the tip of matou-infrastructure PR #6 (infra #3–#5), pushed to both remotes. It stays valid once that PR merges; bump to the merge sha later if you prefer. **Acceptance:** `ansible-playbook playbooks/host.yml --limit matou --check --diff -t coa_shared` → ok=12 changed=8 failed=0 (git pin resolves, config/secrets/Caddy render; the run-only `make up-coa`/wait/probe tasks are gated on `not ansible_check_mode` because `chdir` fires before check mode is honoured); `-t coa` → ok=13 changed=2 failed=0, the new env renders from the vault values into the 0600 compose. Real runs are coa Task 18b/19. Closes #6 Closes #7
roles/coa_shared (coa ADR 0005): pinned checkout of matou-infrastructure at
/opt/coa-shared/src run as `make up-coa` — KERIA, witnesses, schema server,
any-sync and the config server in tenant mode, ports +2000 — Caddy
coa-infra.<domain> -> 127.0.0.1:5904, ufw for the raw-port services
(5901-5903, 7642-7647, 9723, 3001-3006/tcp, 3011-3016/udp). Clones the
PUBLIC GitLab remote anonymously (the Forgejo copy is private); the pin
must therefore be on GitLab. Wired after coa in playbooks/host.yml;
matou enables it and pins ff581b7c (infra PR #6 = infra #3-#5).

roles/coa: compose gains GITHUB_DISPATCH_TOKEN, COA_BUILDS_*,
BUILD_WEBHOOK_SECRET, COA_NOTIFY_EMAIL, COA_SHARED_ADMIN_URL/TOKEN/PUBLIC_URL
(coa ADR 0004/0005); assert requires the three new vault secrets.
secrets.yml.example documents the COA block; CHANGELOG entry.

--check --diff against matou: coa_shared ok=12 changed=8 failed=0,
coa ok=13 changed=2 failed=0. Run-only tasks are gated on
not ansible_check_mode (chdir fires before check mode is honoured).

Matou/matou-distributed-servers#6 #7
ben merged commit 6f108023b8 into main 2026-09-01 00:54:29 +00:00
Sign in to join this conversation.
No reviewers
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
Matou/matou-distributed-servers!10
No description provided.