tweaked k3s start

This commit is contained in:
Karim Naufal 2022-02-20 13:36:41 +01:00
parent 4b4bd0697a
commit 11dc61a39e
2 changed files with 4 additions and 4 deletions

View File

@ -59,11 +59,11 @@ resource "null_resource" "agents" {
# Start the k3s agent and wait for it to have started
provisioner "remote-exec" {
inline = [
"systemctl start k3s-agent",
"systemctl start k3s-agent 2> /dev/null",
<<-EOT
timeout 120 bash <<EOF
until systemctl status k3s-agent > /dev/null; do
systemctl start k3s-agent
systemctl start k3s-agent 2> /dev/null
echo "Waiting for the k3s agent to start..."
sleep 2
done

View File

@ -65,11 +65,11 @@ resource "null_resource" "control_planes" {
# Start the k3s server and wait for it to have started correctly
provisioner "remote-exec" {
inline = [
"systemctl start k3s",
"systemctl start k3s 2> /dev/null",
<<-EOT
timeout 120 bash <<EOF
until systemctl status k3s > /dev/null; do
systemctl start k3s
systemctl start k3s 2> /dev/null
echo "Waiting for the k3s server to start..."
sleep 2
done