From af592adb9b1b7e8c7b647b7f64ef95ad8ba6fca1 Mon Sep 17 00:00:00 2001 From: Karim Naufal Date: Wed, 9 Mar 2022 05:42:56 +0100 Subject: [PATCH 1/2] moved to random string for the node name --- modules/host/main.tf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/host/main.tf b/modules/host/main.tf index a4de8c6..70b2aaa 100644 --- a/modules/host/main.tf +++ b/modules/host/main.tf @@ -1,5 +1,10 @@ -resource "random_pet" "server" { - length = 1 +resource "random_string" "server" { + length = 3 + lower = true + special = false + number = false + upper = false + keepers = { # We re-create the id (and server) whenever one of those attributes # changes. This should include all input variables to this module, From 863fa15207c642fc42735d6390075330cd8584fe Mon Sep 17 00:00:00 2001 From: Karim Naufal Date: Wed, 9 Mar 2022 05:50:12 +0100 Subject: [PATCH 2/2] small fix --- modules/host/locals.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/host/locals.tf b/modules/host/locals.tf index 46e0f81..4edc40e 100644 --- a/modules/host/locals.tf +++ b/modules/host/locals.tf @@ -12,5 +12,5 @@ locals { ssh_args = "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ${local.ssh_identity_file}" # the hosts name with its unique suffix attached - name = "${var.name}-${random_pet.server.id}" + name = "${var.name}-${random_string.server.id}" }