install terraform

warning

hashcorp enabled access restrictions depending on your location – eventually workaround sanctions with:

  1. curl --socks5
  2. apt-cacher-ng

let’s proceed with both at once

as user

ssh some-server-in-the-west -L 3142:localhost:3142 -D 1080

point to the proxied repository

as root

cd /etc/apt/apt.conf.d/
vi 01proxy

Acquire::http::Proxy::apt.releases.hashicorp.com "http://localhost:3142";

install

as root

cd /usr/share/keyrings/
ls -lF hashicorp-archive-keyring.key # no exist
curl --socks5 localhost:1080 https://apt.releases.hashicorp.com/gpg -o hashicorp-archive-keyring.key

apt install gnupg1
ls -lF hashicorp-archive-keyring.gpg # no exist
cat hashicorp-archive-keyring.key | gpg1 --dearmor > hashicorp-archive-keyring.gpg
ls -lF /etc/apt/sources.list.d/hashicorp.list # no exist
cat > /etc/apt/sources.list.d/hashicorp.list <<EOF
deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com `lsb_release -cs` main
EOF
apt update
apt install terraform ansible

#snap install terragrunt
mkdir /usr/local/bin/
cd /usr/local/bin/
# https://github.com/gruntwork-io/terragrunt/releases
wget https://github.com/gruntwork-io/terragrunt/releases/download/v0.68.1/terragrunt_linux_amd64
chmod +x terragrunt_linux_amd64
ln -s terragrunt_linux_amd64 terragrunt
cd ~/

as user

terraform version
terraform -install-autocomplete
terragrunt --version

yandex provider

make sure you’ve installed yandex cli

be able to reach your provider

    vi ~/.terraformrc
provider_installation {
  network_mirror {
    url = "https://terraform-mirror.yandexcloud.net/"
    include = ["registry.terraform.io/*/*"]
  }
  direct {
    exclude = ["registry.terraform.io/*/*"]
  }
}

clean-up

as root

mv -i /etc/apt/sources.list.d/hashicorp.list /etc/apt/sources.list.d/hashicorp.list.disabled

vi /etc/apt/apt.conf.d/01proxy

#Acquire::...

resources

https://developer.hashicorp.com/terraform/install


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun