Skip to content

Commit

Permalink
Feat/terraform1x install (#1983)
Browse files Browse the repository at this point in the history
* Added the ability to install Terraform 1.2 to the work vms.

* Fixed a typo in kube-setup-workvm.sh
  • Loading branch information
AidanHilt authored Jun 29, 2022
1 parent 7a68bfa commit 6fec800
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions gen3/bin/kube-setup-workvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ if sudo -n true > /dev/null 2>&1 && [[ $(uname -s) == "Linux" ]]; then
/bin/rm -rf "${XDG_RUNTIME_DIR}/t12"
}

install_terraform1.2() {
mkdir "${XDG_RUNTIME_DIR}/t1.2"
curl -o "${XDG_RUNTIME_DIR}/t1.2/terraform1.2.zip" https://releases.hashicorp.com/terraform/1.2.3/terraform_1.2.3_linux_amd64.zip
sudo /bin/rm -rf /usr/local/bin/terraform1.2 > /dev/null 2>&1 || true
unzip "${XDG_RUNTIME_DIR}/t1.2/terraform1.2.zip" -d "${XDG_RUNTIME_DIR}/t1.2";
sudo cp "${XDG_RUNTIME_DIR}/t1.2/terraform" "/usr/local/bin/terraform1.2"
/bin/rm -rf "${XDG_RUNTIME_DIR}/t1.2"
}

if ! which terraform > /dev/null 2>&1; then
install_terraform
else
Expand All @@ -154,6 +163,14 @@ if sudo -n true > /dev/null 2>&1 && [[ $(uname -s) == "Linux" ]]; then
install_terraform12
fi
fi
if ! which terraform1.2 > /dev/null 2>&1; then
install_terraform1.2
else
T12_VERSION=$(terraform1.2 --version | head -1 | awk '{ print $2 }' | sed 's/^[^0-9]*//')
if ! semver_ge "$T12_VERSION" "1.2.3"; then
install_terraform12
fi
fi
)

if [[ -f /etc/systemd/timesyncd.conf ]] \
Expand Down

0 comments on commit 6fec800

Please sign in to comment.