added a flag for the node names

This commit is contained in:
Karim Naufal
2022-03-05 04:02:09 +01:00
parent b2d160f33a
commit ae731a7746
5 changed files with 13 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ module "agents" {
for_each = local.agent_nodepools
name = "${each.value.nodepool_name}-${random_pet.cluster.id}-${random_pet.agents[each.key].id}"
name = var.use_cluster_name_in_node_name ? "k3s-${random_pet.cluster.id}-${each.value.nodepool_name}-${random_pet.agents[each.key].id}" : "${each.value.nodepool_name}-${random_pet.agents[each.key].id}"
ssh_keys = [hcloud_ssh_key.k3s.id]
public_key = var.public_key
private_key = var.private_key