From 74cb1aec85c5017528ccbe339009a21f1dc1c831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Sat, 4 Mar 2023 10:18:35 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20=20Store=20terraform=20var?= =?UTF-8?q?iables=20(#=20of=20nodes...)=20in=20tfvars=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using environment variables was a mistake, because they must be set again manually each time we want to re-apply the Terraform configurations. Instead, put the variables in a tfvars file. --- prepare-tf/run.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/prepare-tf/run.sh b/prepare-tf/run.sh index 66b75d93..0f5cda33 100755 --- a/prepare-tf/run.sh +++ b/prepare-tf/run.sh @@ -27,12 +27,8 @@ fi } PROVIDER="$1" -export TF_VAR_location="$2" -export TF_VAR_how_many_clusters="${3-1}" -export TF_VAR_min_nodes_per_pool="${4-2}" -export TF_VAR_max_nodes_per_pool="${5-4}" -[ "$TF_VAR_location" ] || { +[ "$2" ] || { "./source/modules/$PROVIDER/list_locations.sh" exit 1 } @@ -68,6 +64,12 @@ export DIGITALOCEAN_ACCESS_TOKEN=$(grep ^access-token ~/.config/doctl/config.yam cp -a source $TAG cd $TAG cp -r modules/$PROVIDER modules/PROVIDER +cat >terraform.tfvars <