Scaffold terraform-rancher: Authentik OIDC auth config #1
Reference in New Issue
Block a user
Delete Branch "benvin/scaffold"
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?
Why
Manages Rancher's Keycloak(OIDC) auth provider declaratively via the rancher2 provider, pointed at Authentik — so Rancher access uses Authentik identity/groups. Chosen over a raw AuthConfig CR because the provider handles the verify/enable flow properly (no ArgoCD drift, no admin lockout). Mirrors the terraform-authentik layout.
Contents
modules/rancher:rancher2_auth_config_keycloak_oidc— client_secret read from Vault (kv/kubernetes/namespace/cattle-system/default/oauth-credentials, the same secret Authentik sets on itsrancherprovider).access_mode = unrestrictedso enabling can't lock the admin out; roles assigned to users/groups separately.config/keycloakoidc.yaml: issuer/auth_endpoint atidentity.unkin.net,client_id: rancher,/verify-authredirect, openid/profile/email scopes.environments/rancher.k8s.syd1.au.unkin.net: Consul state atinfra/terraform/rancher/, rancher2api_urlderived from the env name.terraform-rancher); Vault-sourced admin token.Validation
tofu validatepasses — config is valid against the rancher2 provider (resource type + all fields confirmed; pinned rancher2 v14.1.1).Blocked on
A live
planneeds a Rancher admin API token seeded in Vault atkv/service/terraform/rancher(fieldtoken). Until then CIplanwill be red. Rancher API tokens have a 90-day max — to move to a dedicated Vault Rancher secrets engine (noted in the Makefile/README).Depends on: terraform-authentik#6 (provider), terraform-vault#86 (runner auth+state — merged), argocd-apps#257 (woodpecker SA).
153bbf7d74to5fd2fb3b8f5fd2fb3b8fto90a01563dc