1、CentOS上安装Terraform首先需要安装yum-utils包来将HashiCorp仓库添加进系统,如果你一上来直接用yum install terraform的话。因此第一步:
yum install -y yum-utils
2、然后将HashiCorp仓库添加进YUM仓库: yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
3、最后yum install -y terraform即可。
4、安装完毕后,需根据你自己的需要安装provider的插件,现在terraform已经支持接近2000个左右的基础架构插件,具体支持哪些,可以到terraform官网去查找:registry.terraform.io
比如现在我们需要加入vsphere:
找到后,将其克隆至本机:
git clone https://github.com/hashicorp/terraform-provider-vsphere.git
最后ls grep|terraform确认一下vsphere trraform provider已下载到本地。