Skip to content

Instantly share code, notes, and snippets.

@github-somerandomguy-xyz
Last active April 20, 2020 17:34
Show Gist options
  • Save github-somerandomguy-xyz/c3c4c6d0c4cb059b522ef76ab7fac9e3 to your computer and use it in GitHub Desktop.
Save github-somerandomguy-xyz/c3c4c6d0c4cb059b522ef76ab7fac9e3 to your computer and use it in GitHub Desktop.
install terraform
---
- name: Ensure required packages are available.
package:
name:
- unzip
state: present
- name: "Download terraform {{ terraform_version }} binary."
get_url:
url: "{{ terraform_download_url }}"
dest: /tmp/
- name: unarchive and move terraform binary to executable location
unarchive:
src: "/tmp/terraform_{{ terraform_version }}_linux_amd64.zip"
dest: /usr/local/bin/
remote_src: yes
- name: change terraform file permissions
file:
path: /usr/local/bin/terraform
mode: u+x
owner: "{{ansible_user}}"
group: "{{ansible_user}}"
- name: cleanup residue
file:
path: "/tmp/terraform_{{ terraform_version }}_linux_amd64.zip"
state: absent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment