This role installs the Terraform CLI on Windows or Linux servers.
There are no external requirements for this role.
There are a few variables that can be set from the playbook if you like and the role makes an assumption in the defaults section.
This is the version of terraform that will be installed, the complete list can be found on the Hashicorp Releases page. The value should only include everything after 'terraform_' so for the latest version the value would be:
terraform_version: 0.14.3
This is the directory where the Terraform installation package will be downloaded to.
download_dir: "C:\\Windows\\Temp"
download_dir: "/tmp"
This is the directory where Terraform is installed into
terraform_dir: "C:\\ProgramData\\Hashicorp\\Terraform"
terraform_dir: "/opt/terraform"
There are no external dependencies for this role.
A playbook for installing the latest version of Terraform to all hosts
- hosts: all
roles:
- terraform
vars:
terraform_version: 0.14.3
A playbook for installing a specific version of Terraform to a different location on Windows.
- hosts: windows
roles:
- terraform
vars:
terraform_version: 0.14.0
terraform_dir: "C:\\Program Files\Terraform"
MIT
My name is Jeff Patton, feel free to contact me via issues.