zuul-jobs/roles/ensure-go/tasks/install-go.yaml
vass 6dabffe402 Rename install-go to ensure-go for consistency
The old role will be kept and include ensure-go for backwards-compatability.

Change-Id: I4e6345563817057a6c47c124b9ec8b0c62b057d6
2020-04-06 21:10:11 +02:00

26 lines
758 B
YAML

- name: Create temp directory
tempfile:
state: directory
register: go_archive_tempdir
- name: Get archive checksum
uri:
url: "https://dl.google.com/go/go{{ go_version }}.{{ go_os }}-{{ go_arch }}.tar.gz.sha256"
return_content: true
register: go_archive_checksum
- name: Download go archive
get_url:
url: "https://dl.google.com/go/go{{ go_version }}.{{ go_os }}-{{ go_arch }}.tar.gz"
dest: "{{ go_archive_tempdir.path }}/go{{ go_version }}.{{ go_os }}-{{ go_arch }}.tar.gz"
checksum: "sha256:{{ go_archive_checksum.content }}"
- name: Install go
unarchive:
src: "{{ go_archive_tempdir.path }}/go{{ go_version }}.{{ go_os }}-{{ go_arch }}.tar.gz"
dest: "{{ go_install_dir }}"
remote_src: yes
become: true