Mar 282020
 

我是在CentOS 7下做这个测试,对于别的linux版本,都是一样的。包括Ubuntu / Debian / CentOS / Fedora / Arch Linux

https://computingforgeeks.com/how-to-install-terraform-on-linux/

照着这篇文章练习了一遍,有一个非常不错的地方,获取软件的新版本,直接安装。

需要确保机器上已经安装 wget curl,unzip

TER_VER=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d \"\,\v | awk '{$1=$1};1'`
wget https://releases.hashicorp.com/terraform/${TER_VER}/terraform_${TER_VER}_linux_amd64.zip

第一行命令是获取当前软件在github的最新版本。

unzip terraform_${TER_VER}_linux_amd64.zip
mv terraform /usr/local/bin/

安装就已经完成。检测一下

terraform-install

 Leave a Reply

(required)

(required)

This site uses Akismet to reduce spam. Learn how your comment data is processed.