Skip to content

Commit 3671b8d

Browse files
authored
fix: use deploy path properly (#83)
Signed-off-by: matttrach <matt.trachier@suse.com>
1 parent 6e320e4 commit 3671b8d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • modules/install_cert_manager

modules/install_cert_manager/main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ locals {
1414
cert_manager_configured = (local.configure_cert_manager ? "configured" : "unconfigured")
1515
cert_manager_path = "${abspath(path.module)}/${local.cert_manager_configured}"
1616
cert_manager_config = var.cert_manager_configuration
17-
deploy_path = "${local.path}/install_cert_manager/"
17+
deploy_path = "${abspath(local.path)}/install_cert_manager"
1818
backend_file = var.backend_file
1919
}
2020

@@ -68,7 +68,7 @@ resource "local_file" "inputs" {
6868
aws_secret_access_key = "${local.cert_manager_config.aws_secret_access_key}"
6969
}
7070
EOT
71-
filename = "${local.path}/install_cert_manager/inputs.tfvars"
71+
filename = "${local.deploy_path}/inputs.tfvars"
7272
}
7373

7474
# this is a one way operation, there is no destroy or update
@@ -83,14 +83,15 @@ resource "terraform_data" "create" {
8383
}
8484
provisioner "local-exec" {
8585
command = <<-EOT
86+
cd ${local.deploy_path}
8687
export KUBECONFIG=${abspath(local.path)}/kubeconfig
8788
export KUBE_CONFIG_PATH=${abspath(local.path)}/kubeconfig
8889
8990
EXITCODE=1
9091
ATTEMPTS=0
9192
MAX=1
9293
while [ $EXITCODE -gt 0 ] && [ $ATTEMPTS -lt $MAX ]; do
93-
timeout 3600 terraform apply -var-file="inputs.tfvars" -auto-approve -state="${abspath(local.path)}/install_cert_manager/tfstate"
94+
timeout 3600 terraform apply -var-file="inputs.tfvars" -auto-approve -state="${local.deploy_path}/tfstate"
9495
EXITCODE=$?
9596
ATTEMPTS=$((ATTEMPTS+1))
9697
echo "waiting 30 seconds between attempts..."

0 commit comments

Comments
 (0)