fix(opentofu): keep instances on a key change, narrow the opentofu client scope #826
Inga granskare
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!826
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "fix/tofu-instances-and-master-scope"
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?
Closes #611. Closes #800.
#611: a key change no longer replaces the instances
ssh_public_keyreaches the instances only throughuser_data, which is ForceNew. The prod,monitoring and staging instances now ignore
user_datachanges. The keypair resource still takesthe new key: Nova reads it at boot, and the instances refer to it by name, so it does not force a
replace. The runbook has a new section, "Rotate the admin SSH key", that rotates through the
Ansible
authorized_keymodule.A deliberate rebuild with new cloud-init now needs
-replace.#800: full scope off on the master-realm
opentofuclientfull_scope_allowed = false, and akeycloak_generic_role_mappermaps the masteradmincomposite into the client scope. That composite holds every realm's admin roles, so the provider,
the
admin_tokenlookup and the keycloak role's admin-events call keep their access.Keycloak checks the client scope on every admin call. One apply would flip the flag before it
creates the mapping, and
-targeton the mapping applies the client change too. So the runbook("The
opentofuclient scope") adds the mapping over the API first. It also describes a repairpath through a temporary
bootstrap-opentofuservice client, created withkc.sh bootstrap-admin service(Keycloak 26.8).No workflow applies
opentofu/keycloak. CI only runsfmtandvalidate, so nothing applies theflag before the operator adds the mapping.
Checks
tofu fmt -check -recursiveinopentofu/: clean.tofu validateinopentofu/andopentofu/keycloak/(freshinit -backend=false): valid.docs/runbook.md: clean.Operator steps
pnpm tofu:planagainst prod state shows no changes to the three instances.ssh_public_key. Onlyopenstack_compute_keypair_v2.bitborgis replaced.opentofuclient scope").tofu plan -detailed-exitcodeexits 0.--tags keycloakand the health gate. Both still pass.opentofu.