All Projects → robertpeteuil → terraform-installer

robertpeteuil / terraform-installer

Licence: Apache-2.0 license
Installer for HashiCorp Terraform - Automatic Download, Extract and Install of Latest or Specific Version

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to terraform-installer

Termuxarch
You can use setupTermuxArch.bash 📲 to install Arch Linux in Amazon, Android, Chromebook and Windows. https://sdrausty.github.io/TermuxArch/docs/install
Stars: ✭ 653 (+782.43%)
Mutual labels:  installer, bash-script
zarch
The Ultimate Script For Arch Linux
Stars: ✭ 49 (-33.78%)
Mutual labels:  installer, bash-script
termux-arch
You can use setupTermuxArch.sh 📲 to install Arch Linux in Termux on Android and Chrome. This setup script will attempt to set Arch Linux up in your Termux environment.
Stars: ✭ 25 (-66.22%)
Mutual labels:  installer, bash-script
gotf
Managing multiple environments with Terraform made easy
Stars: ✭ 25 (-66.22%)
Mutual labels:  hashicorp, hashicorp-terraform
magento2-installer-bash-script
Simplistic Magento 2 Installer Bash Script
Stars: ✭ 38 (-48.65%)
Mutual labels:  installer, bash-script
Bpkg
Lightweight bash package manager
Stars: ✭ 1,601 (+2063.51%)
Mutual labels:  installer, bash-script
nginx-installer
Bash script designed to ease the process of compiling nginx with multiple patches and modules manually.
Stars: ✭ 28 (-62.16%)
Mutual labels:  installer, bash-script
Mtprotoproxyinstaller
One-click script to install MTProto Proxy server on CentOS, Ubuntu and Debian
Stars: ✭ 216 (+191.89%)
Mutual labels:  installer, bash-script
installer-scripts
💻 Bash scripts for doing installations in one go.
Stars: ✭ 17 (-77.03%)
Mutual labels:  installer, bash-script
libvirt-ocp4-provisioner
Automate your OCP4 installation
Stars: ✭ 82 (+10.81%)
Mutual labels:  hashicorp, hashicorp-terraform
Actor
📥 ACT One-click Ready. Prepare plug-ins and settings for use with FFXIV
Stars: ✭ 19 (-74.32%)
Mutual labels:  installer
vault-consul-swarm
Deploy Vault and Consul with Docker Swarm
Stars: ✭ 20 (-72.97%)
Mutual labels:  hashicorp
vault-load-testing
Automated load tests for Vault and Consul using the locust.io Python framework
Stars: ✭ 44 (-40.54%)
Mutual labels:  hashicorp
soap2day-dl
📺 Soap2day downloader: download TV series and movies in your terminal
Stars: ✭ 29 (-60.81%)
Mutual labels:  bash-script
rbackup
Shell script for encrypted backups with rsync and GnuPG
Stars: ✭ 22 (-70.27%)
Mutual labels:  bash-script
edx.scripts
Covers 80% of the admin tasks you'll ever need to perform on your Open edX installation
Stars: ✭ 38 (-48.65%)
Mutual labels:  bash-script
linux-android-backup
Back up your device without vendor lock-ins, using insecure software or root. Supports encryption and compression out of the box. Works cross-platform.
Stars: ✭ 119 (+60.81%)
Mutual labels:  bash-script
btrfs-backup
A simple, flexible script for versioned backups using btrfs and rsync
Stars: ✭ 59 (-20.27%)
Mutual labels:  bash-script
sysz
An fzf terminal UI for systemctl
Stars: ✭ 1,258 (+1600%)
Mutual labels:  bash-script
stein
A linter for config files with a customizable rule set
Stars: ✭ 92 (+24.32%)
Mutual labels:  hashicorp

Installer for HashiCorp Terraform - Automated Installation

Automatically Download, Extract and Install Latest or Specific Version

release bash license


The terraform-install script automates the process of downloading and installing Terraform. It provides an ideal method for installing installing updates or a specific version.

This script detects the latest version, OS and CPU-Architecture and allows installation to local or system locations. Optional parameters allow installing a specific version and installing to /usr/local/bin without prompting.

Example - install last pre-0.13 release: ./terraform-install.sh -i 0.12.29

Options:

  • -i VERSION: Install specific version
  • -a: Automatically use sudo to install to /usr/local/bin
    • allows for unattended installation via scripts or CD tools
    • can be set as default behavior by uncommenting line 14 (sudoInstall=true)
    • sudo password may be required unless NOPASSWD is enabled
  • -c: leave binary in working directory (for CI/DevOps use)
  • -h: help
  • -v: display version

This installer is similar to my Packer Installer and Vault Installer

Download and Use Locally

Download Installer

curl -LO https://raw.github.com/robertpeteuil/terraform-installer/master/terraform-install.sh
chmod +x terraform-install.sh

Download installer via my bootstrap server (iac.sh or https://iac.sh)

curl iac.sh/terraform > getinst.sh
bash getinst.sh
# installer downloaded as terraform-install.sh in current directory

Run local installer

./terraform-install.sh

# usage: terraform-install.sh [-i VERSION] [-a] [-c] [-h] [-v]
#      -i VERSION	: specify version to install in format '' (OPTIONAL)
#      -a		: automatically use sudo to install to /usr/local/bin
#      -c		: leave binary in working directory (for CI/DevOps use)
#      -h		: help
#      -v		: display vault-install.sh version

System Requirements

  • System with Bash Shell (Linux, macOS, Windows Subsystem for Linux)
  • unzip - terraform downloads are in zip format
  • curl or wget - script will use either one to retrieve metadata and download

Optional

  • jq - if installed, latest version parsed from hashicorp downloads
    • Useful if latest github release differs from version on hashicorp downloads
    • Avoids github api limit of 60 requests per hour (unauthenticated)

Script Process Details

  • Determines Version to Download and Install
    • Uses Version specified by -i VERSION parameter (if specified)
    • Otherwise determines Latest Version
      • If jq installed parse version from hashicorp downloads
      • Otherwise use GitHub API to retrieve latest version
  • Calculates Download URL based on Version, OS and CPU-Architecture
  • Verifies URL Validity before Downloading in Case:
    • VERSION incorrectly specified with -i
    • Download URL Format Changed on terraform Website
  • Determines Install Destination
    • The destination can be specified with -c option, or passing TF_INSTALL_DIR environment variable
    • The default is /usr/local/bin if it is writable, or with -a
    • Otherwise the user is prompted for options
    • Performed before Download/Install Process in case user selects abort
  • Installation Process
    • Download, Download SHA, Verify SHA of zip, Extract, Install, Cleanup and Display Results

CPU Architecture Detection

CPU architecture is detected for each OS accordingly:

  • Linux / Windows (WSL since this is a Bash script)
    • detected with lscpu or by inspecting /proc/cpuinfo
    • Arm variants use arm as it's the only arm version available (for now)
  • macOS - uses Default Arch amd64 as it's the only version available on macOS
  • Default Value - amd64

Disclaimer

I am a HashiCorp employee, but this is a personal project and not officially endorsed or supported by HashiCorp.

License

Apache 2.0 License - Copyright (c) 2020 Robert Peteuil

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].