Skip to content

Commit

Permalink
fetch checksum in separate task
Browse files Browse the repository at this point in the history
  • Loading branch information
yogo1212 committed Feb 26, 2018
1 parent b1b6cc7 commit 18dc711
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ go_tarball_name: "go{{ go_version }}.linux-amd64.tar.gz"
# mirror for Go release tarballs
go_mirror: "https://storage.googleapis.com/golang/"

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

# (TODO defaults->documentation)
# using tarball_name+".sha256"
#go_tarball_checksum: "sha256:b5a64335f1490277b585832d1f6c7f8c6c11206cba5cd3f771dcb87b98ad1a33"

# the signature will be fetched from the mirror
# using tarball_name+".asc"
go_check_signature: true
Expand Down
6 changes: 5 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@

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

- name: Fetching sha256 checksum
set_fact:
go_tarball_checksum: "sha256:{{ lookup('url',go_tarball_url+'.sha256') }}"
when: go_tarball_checksum is not defined

- name: Create download dir
file: state=directory path="{{ go_download_dir }}" mode=0755

Expand Down

0 comments on commit 18dc711

Please sign in to comment.