k3s-ansible/roles/download/tasks/main.yml
Lennart Jern 6873913124 Use checksum with get_url
When the checksum is used there is no need to delete the binary first, 
as it will be compared to the checksum and downloaded and replaced only 
as needed.
2020-09-20 21:19:44 +03:00

37 lines
1.2 KiB
YAML

---
- name: Download k3s binary x64
get_url:
url: https://github.com/rancher/k3s/releases/download/{{ k3s_version }}/k3s
checksum: sha256:https://github.com/rancher/k3s/releases/download/{{ k3s_version }}/sha256sum-amd64.txt
dest: /usr/local/bin/k3s
owner: root
group: root
mode: 0755
when: ansible_facts.architecture == "x86_64"
- name: Download k3s binary arm64
get_url:
url: https://github.com/rancher/k3s/releases/download/{{ k3s_version }}/k3s-arm64
checksum: sha256:https://github.com/rancher/k3s/releases/download/{{ k3s_version }}/sha256sum-arm64.txt
dest: /usr/local/bin/k3s
owner: root
group: root
mode: 0755
when:
- ( ansible_facts.architecture is search("arm") and
ansible_facts.userspace_bits == "64" ) or
ansible_facts.architecture is search("aarch64")
- name: Download k3s binary armhf
get_url:
url: https://github.com/rancher/k3s/releases/download/{{ k3s_version }}/k3s-armhf
checksum: sha256:https://github.com/rancher/k3s/releases/download/{{ k3s_version }}/sha256sum-arm.txt
dest: /usr/local/bin/k3s
owner: root
group: root
mode: 0755
when:
- ansible_facts.architecture is search("arm")
- ansible_facts.userspace_bits == "32"