aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries
diff options
context:
space:
mode:
authorpmikus <pmikus@cisco.com>2021-08-09 14:54:03 +0000
committerPeter Mikus <pmikus@cisco.com>2021-08-09 14:55:54 +0000
commiteb015c752a174128fddcefcdca92aceeb898f331 (patch)
tree0219d536fff756e902c7229ec64c10cb848d2bbc /resources/libraries
parent80dd1f37920dbb332f8fe192313a57352af2e582 (diff)
FIX: Terraform installation
Signed-off-by: pmikus <pmikus@cisco.com> Change-Id: I2963520237c0bcc30836df3722a945060bd438d3 (cherry picked from commit 2674845e28c3f36e6290c78bd73c0a43b0ecca15) (cherry picked from commit 0e5b90cc8dad50365de53fa80db9817066ac3f82)
Diffstat (limited to 'resources/libraries')
-rw-r--r--resources/libraries/bash/function/terraform.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/resources/libraries/bash/function/terraform.sh b/resources/libraries/bash/function/terraform.sh
index 929cdd87c8..c076f52859 100644
--- a/resources/libraries/bash/function/terraform.sh
+++ b/resources/libraries/bash/function/terraform.sh
@@ -75,8 +75,10 @@ function terraform_init () {
set -exuo pipefail
if ! installed terraform; then
- repo="deb [arch=amd64] https://apt.releases.hashicorp.com focal main"
- echo "${repo}" >> "/etc/apt/sources.list" || die "Failed to add repo!"
+ curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
+ os="$(lsb_release -cs)" || die "Failed to get OS release!"
+ repo="deb [arch=amd64] https://apt.releases.hashicorp.com ${os} main"
+ sudo apt-add-repository "${repo}" || die "Failed to add repo!"
apt update -y
apt install -y terraform
#die "Please install terraform!"