making k3s start more robust

This commit is contained in:
Karim Naufal
2022-02-20 02:04:37 +01:00
parent c49a65308b
commit e39dc064e2
4 changed files with 7 additions and 3 deletions

View File

@@ -77,13 +77,14 @@ resource "hcloud_server" "control_planes" {
inline = local.install_k3s_server
}
# Upon reboot verify that the k3s server starts correctly
# Start the k3s server and wait for it to have started correctly
provisioner "remote-exec" {
inline = [
"systemctl start k3s",
<<-EOT
timeout 120 bash <<EOF
until systemctl status k3s > /dev/null; do
systemctl start k3s
echo "Waiting for the k3s server to start..."
sleep 2
done