OpenBao: apply the vault IaC root to OpenBao via tofu-controller (fresh state, import hand-made config) #47
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/iac#47
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of lab/machine-configs#7. Feeds lab/clusters#1669 ("Vault IaC roots (tofu-controller) retargeted at OpenBao").
OpenBao now runs on think-01..03 (lab/machine-configs#8, closed 2026-11-07). The
iac/vaultroot (applied by tofu-controller on mini,clusters/mini/iac/vault-config.yaml) still targets the mini Vault. Applying the same root against OpenBao brings the non-secret config up to spec: Kanidm JWT/OIDC logins, superadmin identity groups and aliases, thesecretKV mount, the per-app policy module, manager/reader/admin policies.Plan
openbao-config) on the same root with its own state. Reusing the Vault state makes tofu believe resources exist that OpenBao never had.importblocks: mountpki-infra(pki, issuers imported from the ceremony), mountinfra(kv-v2), policyraft-snapshot, authkubernetes-think+ its config + roleraft-snapshot.pki-apiserver(vault_pki_secret_backend_root_certwith an internal ed25519 root): it contradicts the offline root on hardware (#9). Replaced bypki-k3s-<cluster>intermediates signed by the root token.https://10.10.1.21-23:8200(lab root CA in the runner's trust,VAULT_CACERT). Bootstrap AppRole (ADR 0003) recreated in OpenBao by hand once with the root token; its role_id/secret_id go into the object's varsFrom Secret.hashicorp/vault5.6.0 against OpenBao (Vault 1.14 API). Check every resource type in the root plans clean against 2.7.2 before the first apply.Done when
openbao-configTerraform object Ready on mini,plancleanTwo constraints found while writing the handoff (2026-11-07):
./vaultpath.importblocks iniac/vaultwould also run under the existingvault-configobject against the mini Vault and fail there. Createiac/openbao(reusevault/modules/app_secrets, copy what still applies, droppki.tf), and point the new Terraform object at./openbao.iac/vaultstays untouched until the mini Vault is retired (lab/clusters#1669).clusters/mini/iac/vault-config.yamlhasapprovePlan: "auto". The newopenbao-configobject starts with plan-only (noapprovePlan, or a plan id to approve by hand), so the first plan, which must show only imports and creates, is reviewed before anything is written to OpenBao. Switch toautoonce a plan is clean.Bootstrap AppRole created on OpenBao, 2026-11-11 (ADR 0003: bootstrap-only, never declared or imported by tofu). Run once by hand with the root token from arch-ws; completed successfully.
Notes:
10.44.0.0/16is mini's pod CIDR. If runner traffic reaches the thinks SNATed to the node IP, logins fail; drop the bindings or use mini's node IP.openbao-config-varsis a hand-made Secret on mini, not in git. A mini rebuild needs a fresh secret_id: re-run the last block (newsecret-id, recreate the Secret).auth/approle, policytofu-runnerand roletofu-runnermust never appear in thevaultroot.State of the rest, same day: flux
bc810652(trust-manager Bundlelab-root-caintoflux-system), flux42a534c5(vault-configsuspended,openbao-configplan-only athttps://10.10.1.21:8200), iacb0c3fb7(import blocks,pki.tfdropped). DNS deferred to #50, public UI to #51.2026-11-11: openbao-config applied master@b0c3fb7 (6 imported, 42 created, 0 changed/destroyed), approvePlan auto, vault-config removed (state secret kept). Kanidm CLI login (oidc-cli via vault/scripts/vault-login.py with VAULT_ADDR=https://10.10.1.21:8200) verified by owner: token works, status + auth list OK. Web OIDC login waits on a reachable hostname (#50/#51). Remaining: revoke root token.
Status 2026-11-17: openbao-config object Ready, applies through tofu-controller, hand-made 11-07 objects imported, pki-apiserver gone (c1 CA tree rebuilt under the hardware root 11-12, 7/7 CAs). Still unchecked: Kanidm OIDC login proven CLI+web, and root token revoke still waiting on that web login (see 11-11 note). Leaving open for the human two checkboxes.
Done per owner 2026-11-17: Kanidm OIDC login to OpenBao proven CLI and web, which was the gate for the last two checkboxes. All earlier evidence stands: openbao-config Ready with clean plans through tofu-controller, hand-made 2026-11-07 objects imported not recreated, pki-apiserver gone (CA tree under the hardware root), KV data migration carried by lab/clusters#1669. If the root token somehow survived (it should have been revoked with the proven login), revoking it is a one-liner and deserves its own note rather than this issue.