Last active
April 22, 2019 11:04
-
-
Save HammoTime/4f8573f8a4a15e194fe84604c3173030 to your computer and use it in GitHub Desktop.
Install Terrafrom on Red Hat and derivatives
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum install -y jq wget unzip | |
cd ~ | |
version=$(curl https://api.github.com/repos/hashicorp/terraform/releases/latest --silent | jq ".tag_name" -r) | |
version=$(echo $version | sed 's/v//g') # get rid of 'v' from version number | |
echo "Installing Terraform $version." | |
url="https://releases.hashicorp.com/terraform/$version/terraform_$(echo $version)_linux_amd64.zip" | |
wget $url | |
unzip "terraform_$(echo $version)_linux_amd64.zip" | |
chmod +x terraform | |
sudo mv terraform /usr/local/bin/ | |
echo "Terraform $version installed." | |
rm "terraform_$(echo $version)_linux_amd64.zip" | |
echo "Install files cleaned up." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment