ansible: replace hand-copied literals with their variables #617
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra#617
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
What
Four places hold a literal where a variable already exists. They drift silently on a rename.
roles/forgejo/templates/forgejo.container.j2:76hasSecret=gitborg-postgres-password.postgres_secret_nameexists and the Postgres unit uses it.keycloak_http_portandkeycloak_management_port(group_vars/all/vars.yml:321,323) are not applied to Keycloak.roles/keycloak/files/healthcheck.sh:3hardcodes 9000. The Quadlet unit sets noKC_HTTP_PORTorKC_HTTP_MANAGEMENT_PORT.site.yml:135-144:health_check_servicesuses literal container names. It omitsbitborg-billingand has no Keycloak endpoint.gitborg-prodinbitborg-backup-storage.sh.j2:77andrestore-on-scratch.sh.j2:301,304, whilebitborg-backup-hot.sh.j2:40usesinventory_hostname.Why
A rename or port change in one place leaves the other behind and nothing fails until it matters.
Failing case
postgres_secret_name. Postgres follows. Forgejo still references the old name andpodman createfails with "no such secret".keycloak_management_port: 9001. vmagent scrapes :9001 while Keycloak listens on 9000. The metrics scrape goes dark.restic restore latest --host ...finds no snapshot and the drill fails. Both values agree today. Overlaps the hostname rename in #586, so check that issue first.Fix
{{ postgres_secret_name }}in the Forgejo unit.Environment=KC_HTTP_PORT=...andKC_HTTP_MANAGEMENT_PORT=...to the Keycloak unit. Templatehealthcheck.sh(or pass the port through the environment).health_check_servicesfromweb_container_name,caddy_container_nameandbilling_container_name(whenbilling_enabled). Add a Keycloak/realms/<realm>/.well-known/openid-configurationendpoint whenkeycloak_enabled.backup_restic_hostvariable and use it in the storage backup and both restore scripts.Done when
ansible-playbook --syntax-checkandansible-lintpass.