add random pet names for cluster & nodes

This commit is contained in:
phaer
2022-03-04 22:04:07 +01:00
parent b0b616c4da
commit 5cf6f9eef4
6 changed files with 26 additions and 9 deletions

View File

@@ -1,9 +1,13 @@
resource "random_pet" "agents" {
for_each = local.agent_nodepools
}
module "agents" {
source = "./modules/host"
for_each = local.agent_nodepools
name = each.key
name = "${each.key}-${random_pet.cluster.id}-${random_pet.agents[each.key].id}"
ssh_keys = [hcloud_ssh_key.k3s.id]
public_key = var.public_key
private_key = var.private_key