diff --git a/prepare-tf/README.md b/prepare-tf/README.md index d4281e2d..1fb515d6 100644 --- a/prepare-tf/README.md +++ b/prepare-tf/README.md @@ -53,7 +53,7 @@ The value of the `location` variable is provider-specific. Examples: | Provider | Example value | How to see possible values |---------------|-------------------|--------------------------- | Digital Ocean | `ams3` | `doctl compute region list` -| Google Cloud | `europe-north1-a` | `gcloud compute zones list` +| Google Cloud | `europe-north1-a` | `gcloud compute zones list` | Linode | `eu-central` | `linode-cli regions list` | Oracle Cloud | `eu-stockholm-1` | `oci iam region list` @@ -112,7 +112,7 @@ terraform init See steps above, and add the following extra steps: -- Digital Coean: +- Digital Ocean: ```bash export DIGITALOCEAN_ACCESS_TOKEN=$(grep ^access-token ~/.config/doctl/config.yaml | cut -d: -f2 | tr -d " ") ``` diff --git a/prepare-tf/run.sh b/prepare-tf/run.sh index 8dc06036..723cd6e6 100755 --- a/prepare-tf/run.sh +++ b/prepare-tf/run.sh @@ -3,6 +3,14 @@ set -e TIME=$(which time) +if [ -f ~/.config/doctl/config.yaml ]; then + export DIGITALOCEAN_ACCESS_TOKEN=$(grep ^access-token ~/.config/doctl/config.yaml | cut -d: -f2 | tr -d " ") +fi + +if [ -f ~/.config/linode-cli ]; then + export LINODE_TOKEN=$(grep ^token ~/.config/linode-cli | cut -d= -f2 | tr -d " ") +fi + PROVIDER=$1 [ "$PROVIDER" ] || { echo "Please specify a provider as first argument, or 'ALL' for parallel mode."