From 7cb3c5bd6d17c94324cfdd8d2e389e94932c7b07 Mon Sep 17 00:00:00 2001 From: "Wessel Valkenburg (prevue.ch)" <116259817+valkenburg-prevue-ch@users.noreply.github.com> Date: Fri, 13 Dec 2024 12:49:13 +0100 Subject: [PATCH] Add timeout to "waiting for microos to become available" --- modules/host/main.tf | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/host/main.tf b/modules/host/main.tf index b1973b53..a19e40b7 100644 --- a/modules/host/main.tf +++ b/modules/host/main.tf @@ -63,11 +63,13 @@ resource "hcloud_server" "server" { # Wait for MicroOS to reboot and be ready. provisioner "local-exec" { command = <<-EOT - until ssh ${local.ssh_args} -i /tmp/${random_string.identity_file.id} -o ConnectTimeout=2 -p ${var.ssh_port} root@${self.ipv4_address} true 2> /dev/null - do - echo "Waiting for MicroOS to become available..." - sleep 3 - done + timeout 600 bash < /dev/null + do + echo "Waiting for MicroOS to become available..." + sleep 3 + done + EOF EOT }