Reduce reboot time

This commit is contained in:
Marco Nenciarini
2022-02-07 09:11:07 +01:00
parent 919e1087f8
commit cf68368eea
4 changed files with 20 additions and 9 deletions

View File

@@ -41,9 +41,14 @@ resource "hcloud_server" "first_control_plane" {
}
}
# Issue a reboot command
provisioner "local-exec" {
command = "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root ${self.ipv4_address} '(sleep 2; reboot)&'; sleep 3"
}
# Wait for MicroOS to reboot and be ready
provisioner "local-exec" {
command = "sleep 60 && ping ${self.ipv4_address} | grep --line-buffered 'bytes from' | head -1 && sleep 60"
command = "until ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root -o ConnectTimeout=2 ${self.ipv4_address} true; do sleep 1; done"
}
# Generating k3s master config file