Merge pull request #48 from mnencia/staging

Avoid connection timeout errors while waiting for reboot
This commit is contained in:
Karim Naufal 2022-02-08 00:06:39 +01:00 committed by GitHub
commit 332d66deb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 3 deletions

View File

@ -50,7 +50,13 @@ resource "hcloud_server" "agents" {
# Wait for MicroOS to reboot and be ready # Wait for MicroOS to reboot and be ready
provisioner "local-exec" { provisioner "local-exec" {
command = "ping ${self.ipv4_address} | grep --line-buffered 'bytes from' | head -1 && sleep 10 && until ssh ${local.ssh_args} -o ConnectTimeout=2 root@${self.ipv4_address} true; do sleep 1; done" command = <<-EOT
until ssh ${local.ssh_args} -o ConnectTimeout=2 root@${self.ipv4_address} true 2> /dev/null
do
echo Waiting for ssh to be ready...
sleep 2
done
EOT
} }
# Generating and uploading the angent.conf file # Generating and uploading the angent.conf file

View File

@ -48,7 +48,13 @@ resource "hcloud_server" "first_control_plane" {
# Wait for MicroOS to reboot and be ready # Wait for MicroOS to reboot and be ready
provisioner "local-exec" { provisioner "local-exec" {
command = "ping ${self.ipv4_address} | grep --line-buffered 'bytes from' | head -1 && sleep 10 && until ssh ${local.ssh_args} -o ConnectTimeout=2 root@${self.ipv4_address} true; do sleep 1; done" command = <<-EOT
until ssh ${local.ssh_args} -o ConnectTimeout=2 root@${self.ipv4_address} true 2> /dev/null
do
echo Waiting for ssh to be ready...
sleep 2
done
EOT
} }
# Generating k3s master config file # Generating k3s master config file

View File

@ -49,7 +49,13 @@ resource "hcloud_server" "control_planes" {
# Wait for MicroOS to reboot and be ready # Wait for MicroOS to reboot and be ready
provisioner "local-exec" { provisioner "local-exec" {
command = "ping ${self.ipv4_address} | grep --line-buffered 'bytes from' | head -1 && sleep 10 && until ssh ${local.ssh_args} -o ConnectTimeout=2 root@${self.ipv4_address} true; do sleep 1; done" command = <<-EOT
until ssh ${local.ssh_args} -o ConnectTimeout=2 root@${self.ipv4_address} true 2> /dev/null
do
echo Waiting for ssh to be ready...
sleep 2
done
EOT
} }
# Generating k3s server config file # Generating k3s server config file