Wait with installation until helm and microk8s are available

This commit is contained in:
2023-11-04 16:27:01 +01:00
parent 01499b0d38
commit c86e759c28
3 changed files with 34 additions and 4 deletions
+18 -3
View File
@@ -4,7 +4,12 @@ resource "null_resource" "install_setup" {
user = "terraform"
type = "ssh"
private_key = var.terraform_private_ssh_key
timeout = "2m"
timeout = "10m"
}
provisioner "remote-exec" {
interpreter = ["bash", "-c"]
command = "while (test -z `command -v helm`); do echo \"Waiting for cloud init to finish...\";sleep 5;done"
}
provisioner "file" {
@@ -48,7 +53,12 @@ resource "null_resource" "install_argocd_single" {
user = "terraform"
type = "ssh"
private_key = var.terraform_private_ssh_key
timeout = "2m"
timeout = "10m"
}
provisioner "remote-exec" {
interpreter = ["bash", "-c"]
command = "while (test -z `command -v helm`); do echo \"Waiting for cloud init to finish...\";sleep 5;done"
}
provisioner "remote-exec" {
@@ -70,7 +80,12 @@ resource "null_resource" "install_argocd_ha" {
user = "terraform"
type = "ssh"
private_key = var.terraform_private_ssh_key
timeout = "2m"
timeout = "10m"
}
provisioner "remote-exec" {
interpreter = ["bash", "-c"]
command = "while (test -z `command -v helm`); do echo \"Waiting for cloud init to finish...\";sleep 5;done"
}
provisioner "file" {
+11 -1
View File
@@ -119,7 +119,7 @@ resource "null_resource" "setup_tokens" {
user = "terraform"
type = "ssh"
private_key = var.terraform_private_ssh_key
timeout = "2m"
timeout = "10m"
}
provisioner "local-exec" {
@@ -130,6 +130,11 @@ resource "null_resource" "setup_tokens" {
EOT
}
provisioner "remote-exec" {
interpreter = ["bash", "-c"]
command = "while (test -z `command -v microk8s`); do echo \"Waiting for cloud init to finish...\";sleep 5;done"
}
provisioner "file" {
content = templatefile("${path.module}/templates/add-node.sh",
{
@@ -166,6 +171,11 @@ resource "null_resource" "join_nodes" {
command = "while [[ $(cat /tmp/current_joining_node.txt) != \"${count.index + 1}\" ]]; do echo \"${count.index + 1} is waiting...\";sleep 5;done"
}
provisioner "remote-exec" {
interpreter = ["bash", "-c"]
command = "while (test -z `command -v microk8s`); do echo \"Waiting for cloud init to finish...\";sleep 5;done"
}
provisioner "file" {
content = templatefile("${path.module}/templates/join.sh",
{
@@ -101,6 +101,11 @@ resource "null_resource" "join_workers" {
command = "while [[ $(cat /tmp/current_joining_worker_node.txt) != \"${count.index}\" ]]; do echo \"${count.index} is waiting...\";sleep 5;done"
}
provisioner "remote-exec" {
interpreter = ["bash", "-c"]
command = "while (test -z `command -v microk8s`); do echo \"Waiting for cloud init to finish...\";sleep 5;done"
}
provisioner "file" {
content = templatefile("${path.module}/templates/join-worker.sh",
{