Terraform

Install
https://www.terraform.io/downloads.html

# sudo apt install -y jq
 
URL=$(wget https://checkpoint-api.hashicorp.com/v1/check/terraform -qO- | jq  -r '.current_download_url + .product + "_" + .current_version + "_linux_amd64.zip"')
wget ${URL} -qP /tmp
unzip -d /tmp /tmp/${URL##*/}
sudo cp /tmp/terraform /usr/local/bin/
 
terraform  version

Install with Ansible

---
- name: Request Terraform API
  uri:
    url: "{{ terraform_api_url }}"
    return_content: yes
  register: content

- set_fact:
    terraform_download_url: "{{ content.json.current_download_url }}"
    terraform_version: "{{ content.json.current_version }}"

- name: Download Terraform {{ terraform_version }}
  unarchive:
    src: "{{ terraform_download_url }}terraform_{{ terraform_version }}_{{ ansible_system|lower}}_amd64.zip"
    remote_src: yes
    dest: /usr/local/bin
    creates: /usr/local/bin/terraform
    mode: 0755
    owner: root
    group: root
>
- name: get latest terraform version id
  uri:
    url: 'https://checkpoint-api.hashicorp.com/v1/check/terraform'
    method: GET
    status_code: 200
    timeout: 10
  register: release
 
- set_fact:
    version: "{{ release.json | json_query('current_version') }}"
 
- name: terraform is present
  get_url:
    url: 'https://releases.hashicorp.com/terraform/{{ version }}/terraform_{{ version }}_linux_amd64.zip'
    dest: '/tmp/terraform.zip'
https://github.com/panticz/ansible/tree/master/roles/terraform
- hosts: localhost
  roles:
    - role: terraform
      tags: terraform

Terraform/
https://www.terraform.io/
https://www.youtube.com/watch?v=TFLQcgZr0no#t=1318.264795
https://releases.hashicorp.com/index.json
https://releases.hashicorp.com/