fix(keycloak): tolerate an unpublished image on a fresh host #641

Sammanfogat
supernaut sammanfogade 2 incheckningar från fix/keycloak-soft-pull in i main 2026-10-10 16:55:56 +00:00
Ägare

What

The Keycloak image lives in the host's own Forgejo registry. On a fresh host the keycloak role runs before Forgejo, so its hard pull failed the whole play. The role now follows the billing pattern.

  • Soft pull (failed_when: false), then podman image exists.
  • Image absent: stage the Quadlet unit, print a note, skip the start and the running-image check.
  • Image present: unchanged behaviour (start or restart, readiness gate, pinned-image check).
  • Guard: if the image is absent but the Keycloak database is already initialised, the role fails. A bad tag on a live host stays loud instead of a silent no-op.
  • The role sets keycloak_image_ready. The final health gate in site.yml drops the Keycloak service, endpoint and portal-group checks while it is false (same idea as web_image_ready).
  • Role order is unchanged. The Reload bitborg user systemd handler is shared and already notified by the unit task.
  • Runbook: stand-up step 5 and Keycloak "First start" name the second site.yml pass once the image is pushed.

Checks

  • ansible-playbook site.yml --syntax-check
  • ansible-lint on site.yml and roles/keycloak
  • scripts/check-handlers-unique.py
  • prettier and markdownlint (lefthook)

Not done: the live fresh-host proof (first pass stages and skips, second pass starts Keycloak). Not applied to prod or staging.

Refs #613. The fresh-host proof is still open.

## What The Keycloak image lives in the host's own Forgejo registry. On a fresh host the `keycloak` role runs before Forgejo, so its hard pull failed the whole play. The role now follows the billing pattern. - Soft pull (`failed_when: false`), then `podman image exists`. - Image absent: stage the Quadlet unit, print a note, skip the start and the running-image check. - Image present: unchanged behaviour (start or restart, readiness gate, pinned-image check). - Guard: if the image is absent but the Keycloak database is already initialised, the role fails. A bad tag on a live host stays loud instead of a silent no-op. - The role sets `keycloak_image_ready`. The final health gate in `site.yml` drops the Keycloak service, endpoint and portal-group checks while it is false (same idea as `web_image_ready`). - Role order is unchanged. The `Reload bitborg user systemd` handler is shared and already notified by the unit task. - Runbook: stand-up step 5 and Keycloak "First start" name the second `site.yml` pass once the image is pushed. ## Checks - `ansible-playbook site.yml --syntax-check` - `ansible-lint` on `site.yml` and `roles/keycloak` - `scripts/check-handlers-unique.py` - prettier and markdownlint (lefthook) Not done: the live fresh-host proof (first pass stages and skips, second pass starts Keycloak). Not applied to prod or staging. Refs #613. The fresh-host proof is still open.
supernaut lade till 2 incheckningar 2026-10-10 16:42:22 +00:00
supernaut tvångsskickade fix/keycloak-soft-pull från cd00a44dc0
Alla kontroller lyckades
ci / ci (pull_request) Successful in 1m53s
till 7274fce31c
Alla kontroller lyckades
ci / ci (pull_request) Successful in 1m58s
2026-10-10 16:53:21 +00:00
Jämför
supernaut schemalade den här ändringsförfrågan för automatisk sammanfogning när alla kontroller lyckas 2026-10-10 16:53:33 +00:00
supernaut sammanfogade incheckning 5672fdfc5e till main 2026-10-10 16:55:56 +00:00
supernaut tog bort grenen fix/keycloak-soft-pull 2026-10-10 16:55:56 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-infra!641
Ingen beskrivning angiven.