Ansible role for installating Terraform executable
Only test with ansible 2.5 min version
Available variables are listed below, along with default values (see defaults/main.yml):
# By default, module will download last version
# To specify a version, use this below param
terraform_install_version: X.X.X
# Directory where zip will be downloaded before installation
terraform_download_location: /tmp/
# Url to terraform zip
terraform_url: "https://releases.hashicorp.com/terraform/{{ terraform_install_version | regex_replace('^v', '') }}/terraform_{{ terraform_install_version | regex_replace('^v', '') }}_linux_amd64.zip"
# Downloaded file name
terraform_downloaded_file_name: "terraform_{{ terraform_install_version | regex_replace('^v', '') }}_linux_amd64.zip"
# Path where to install terraform
terraform_execution_path: /usr/local/bin
# Execution file name for terraform
terraform_execution_file_name: terraform
No dependencie
- hosts: all
roles:
- role: ptavares.ansible_role_terraform
Inside vars/main.yml
:
- Copy content of defaults/main.yml in your playbook's vars file if needed.
- Customize it as you like (filling role's variables)
MIT