Merge branch 'bugfix/KASM-7408-fix_terraform_installation_develop' into 'develop'

exclude fedora38,39 for terraform installation

Closes KASM-7408

See merge request kasm-technologies/internal/workspaces-images!286
This commit is contained in:
Richard Koliser
2025-06-17 04:17:11 +00:00

View File

@ -1,17 +1,20 @@
#!/usr/bin/env bash
set -ex
ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g')
if [ "${ARCH}" == "arm64" ] ; then
echo "Terraform for arm64 currently not supported, skipping install"
exit 0
fi
if [[ "${DISTRO}" == @(oracle8|rockylinux9|rockylinux8|oracle9|rhel9|almalinux9|almalinux8) ]]; then
dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
dnf install -y terraform
if [ -z ${SKIP_CLEAN+x} ]; then
dnf clean all
fi
elif [[ "${DISTRO}" == @(fedora39|fedora40) ]]; then
elif [[ "${DISTRO}" == @(fedora40) ]]; then
dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
# use fedora40 hashicorp packages for terraform
sed -i 's/$releasever/40/g' /etc/yum.repos.d/hashicorp.repo
@ -19,6 +22,9 @@ elif [[ "${DISTRO}" == @(fedora39|fedora40) ]]; then
if [ -z ${SKIP_CLEAN+x} ]; then
dnf clean all
fi
elif [[ "${DISTRO}" == @(fedora38|fedora39) ]]; then
# skip installation for fedora38 and fedora39
echo "Skipping terraform install for ${DISTRO}, as it is not officially supported by HashiCorp."
else
yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
yum install -y terraform