terraform: add nixos-exporter shared policy
Some checks failed
Run nix flake check / flake-check (push) Has been cancelled
Some checks failed
Run nix flake check / flake-check (push) Has been cancelled
- Create shared policy granting all hosts access to nixos-exporter nkey - Add policy to both manual and generated host AppRoles - Remove duplicate kanidm01/monitoring02 entries from hosts-generated.tf Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,17 @@ path "secret/data/shared/homelab-deploy/*" {
|
||||
EOT
|
||||
}
|
||||
|
||||
# Shared policy for nixos-exporter NATS cache sharing
|
||||
resource "vault_policy" "nixos_exporter" {
|
||||
name = "nixos-exporter"
|
||||
|
||||
policy = <<EOT
|
||||
path "secret/data/shared/nixos-exporter/*" {
|
||||
capabilities = ["read", "list"]
|
||||
}
|
||||
EOT
|
||||
}
|
||||
|
||||
# Define host access policies
|
||||
locals {
|
||||
host_policies = {
|
||||
@@ -131,7 +142,7 @@ resource "vault_approle_auth_backend_role" "hosts" {
|
||||
backend = vault_auth_backend.approle.path
|
||||
role_name = each.key
|
||||
token_policies = concat(
|
||||
["${each.key}-policy", "homelab-deploy"],
|
||||
["${each.key}-policy", "homelab-deploy", "nixos-exporter"],
|
||||
lookup(each.value, "extra_policies", [])
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user