mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-13 02:12:00 +01:00
a5a651dbb9
Signed-off-by: main <magic_rb@redalder.org>
19 lines
525 B
HCL
19 lines
525 B
HCL
resource "nomad_acl_token" "replication" {
|
|
count = var.replication_token_path != "" ? 1 : 0
|
|
|
|
name = "${var.hostname} in ${var.datacenter} replication token"
|
|
type = "management"
|
|
}
|
|
|
|
|
|
resource "vault_kv_secret_v2" "consul-replication" {
|
|
count = var.replication_token_path != "" ? 1 : 0
|
|
|
|
mount = var.vault_mount.path
|
|
name = var.replication_token_path
|
|
delete_all_versions = true
|
|
data_json = jsonencode({
|
|
secret = nomad_acl_token.replication[0].secret_id
|
|
accessor = nomad_acl_token.replication[0].id
|
|
})
|
|
}
|