From 9380b70bbe6f90deffa6916e0f6688dab6603ea0 Mon Sep 17 00:00:00 2001 From: Karim Naufal Date: Tue, 22 Feb 2022 00:58:08 +0100 Subject: [PATCH] tweak to cluster provisioning null ressource, destroy, and moved lb waiting to master.tf --- main.tf | 33 ++++++--------------------------- master.tf | 10 +++++++++- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/main.tf b/main.tf index 8521b7f..e10cab3 100644 --- a/main.tf +++ b/main.tf @@ -162,34 +162,13 @@ data "hcloud_load_balancer" "traefik" { resource "null_resource" "cluster_provisioning" { - triggers = { - agent_ids = "${join(",", module.agents.*.id)}" - control_plane_ids = "${join(",", concat([module.first_control_plane.id], module.control_planes.*.id))}" - } - - depends_on = [null_resource.first_control_plane, null_resource.control_planes, null_resource.agents] - - provisioner "remote-exec" { - connection { - user = "root" - private_key = local.ssh_private_key - agent_identity = local.ssh_identity - host = module.first_control_plane.ipv4_address - } - - inline = [ - <<-EOT - timeout 120 bash < /dev/null)" ]; do + echo "Waiting for load-balancer to get an IP..." + sleep 2 + done + EOF + EOT ] }