Adjusting provisioner scripts

This commit is contained in:
vandomej 2025-09-28 15:43:30 -07:00
parent 75ad938a1b
commit 65cd9c2b0d

View file

@ -72,6 +72,10 @@ resource "null_resource" "talos_cluster" {
command = <<EOT command = <<EOT
set -e # Exit on error set -e # Exit on error
# Cleaning up any existing configs for this cluster
chmod +x ${path.module}/cleanup.sh
${path.module}/cleanup.sh ${self.triggers.cluster_name}
# Now create the cluster # Now create the cluster
echo "Creating new cluster..." echo "Creating new cluster..."
sudo --preserve-env=HOME talosctl cluster create \ sudo --preserve-env=HOME talosctl cluster create \
@ -92,8 +96,6 @@ resource "null_resource" "talos_cluster" {
provisioner "local-exec" { provisioner "local-exec" {
when = destroy when = destroy
command = <<EOT command = <<EOT
# Call cleanup script
chmod +x ${path.module}/cleanup.sh chmod +x ${path.module}/cleanup.sh
${path.module}/cleanup.sh ${self.triggers.cluster_name} ${path.module}/cleanup.sh ${self.triggers.cluster_name}
EOT EOT