Mount the rancher secrets engine + seed a service account + roles
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/plan Pipeline was successful

Deploys the Rancher token secrets engine into the cluster, mirroring the litellm
and gpg wiring. The plugin is registered separately (config/plugins) and the
deployer policy is granted separately; this mounts and configures the engine.

- Add rancher_secret_backend module (mount + config via the ranchervaultsecret
  provider): rancher_url https://rancher.k8s.syd1.au.unkin.net.
- Add rancher_secret_backend_service_account module: seeds an auto-rotated token
  (90d TTL / 45d rotation), reading the seed token from KV at
  secret_backend/rancher/service_account/<name> (keys: token, token_name).
- Add rancher_secret_backend_role module + a 'ci' role (1h/8h scoped creds).
- Wire config.hcl discovery, module variables, main.tf module blocks, the
  terragrunt inputs, and the rancher provider in root.hcl.

Prereq: populate kv/service/vault/au/syd1/secret_backend/rancher/service_account/admin
with a live Rancher admin token before apply.
This commit is contained in:
Ben Vincent
2026-07-17 23:45:48 +10:00
parent 933de177fa
commit f887489193
17 changed files with 326 additions and 0 deletions
+21
View File
@@ -218,5 +218,26 @@ locals {
})
if startswith(file_path, "gpg_key/")
}
rancher_secret_backend = {
for file_path, content in local.all_configs :
trimsuffix(basename(file_path), ".yaml") => content
if startswith(file_path, "rancher_secret_backend/")
}
rancher_secret_backend_service_account = {
for file_path, content in local.all_configs :
trimsuffix(replace(file_path, "rancher_secret_backend_service_account/", ""), ".yaml") => merge(content, {
name = trimsuffix(basename(file_path), ".yaml")
backend = dirname(replace(file_path, "rancher_secret_backend_service_account/", ""))
})
if startswith(file_path, "rancher_secret_backend_service_account/")
}
rancher_secret_backend_role = {
for file_path, content in local.all_configs :
trimsuffix(replace(file_path, "rancher_secret_backend_role/", ""), ".yaml") => merge(content, {
name = trimsuffix(basename(file_path), ".yaml")
backend = dirname(replace(file_path, "rancher_secret_backend_role/", ""))
})
if startswith(file_path, "rancher_secret_backend_role/")
}
}
}