Skip to content

Commit 18dc711

Browse files
committed
fetch checksum in separate task
1 parent b1b6cc7 commit 18dc711

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

defaults/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ go_tarball_name: "go{{ go_version }}.linux-amd64.tar.gz"
88
# mirror for Go release tarballs
99
go_mirror: "https://storage.googleapis.com/golang/"
1010

11-
#go_tarball_checksum: "sha256:43ad621c9b014cde8db17393dc108378d37bc853aa351a6c74bf6432c1bbd182"
1211
go_version_target: "go version go{{ go_version }} linux/amd64"
1312

13+
# (TODO defaults->documentation)
14+
# using tarball_name+".sha256"
15+
#go_tarball_checksum: "sha256:b5a64335f1490277b585832d1f6c7f8c6c11206cba5cd3f771dcb87b98ad1a33"
16+
1417
# the signature will be fetched from the mirror
1518
# using tarball_name+".asc"
1619
go_check_signature: true

tasks/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@
1414

1515
- name: Setting facts based on previous autodiscovered facts
1616
set_fact:
17-
go_tarball_checksum: "sha256:{{ lookup('url',go_mirror+go_tarball_name+'.sha256') }}"
1817
go_tarball_url: "{{ go_mirror }}{{ go_tarball_name }}"
1918

19+
- name: Fetching sha256 checksum
20+
set_fact:
21+
go_tarball_checksum: "sha256:{{ lookup('url',go_tarball_url+'.sha256') }}"
22+
when: go_tarball_checksum is not defined
23+
2024
- name: Create download dir
2125
file: state=directory path="{{ go_download_dir }}" mode=0755
2226

0 commit comments

Comments
 (0)