mirror of
https://github.com/PyratLabs/ansible-role-k3s
synced 2024-11-09 23:13:30 +01:00
Merge pull request #4 from quulah/fix-sha256sum-parsing
Parse checksum without shell usage
This commit is contained in:
commit
e8e5dbf45a
1 changed files with 3 additions and 8 deletions
|
@ -17,18 +17,13 @@
|
|||
register: k3s_hash_sum_raw
|
||||
|
||||
- name: Ensure sha256sum is set from hashsum variable
|
||||
shell: >
|
||||
set -o pipefail && \
|
||||
echo "{{ k3s_hash_sum_raw.content }}" | \
|
||||
grep -E ' k3s{{ k3s_arch_suffix }}$' | awk '{ print $1 }'
|
||||
set_fact:
|
||||
k3s_hash_sum: "{{ (k3s_hash_sum_raw.content.split('\n') | select('search', k3s_arch_suffix) | first).split() | first }}"
|
||||
changed_when: false
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: k3s_hash_sum
|
||||
|
||||
- name: Ensure k3s binary is downloaded
|
||||
get_url:
|
||||
url: "{{ k3s_binary_url }}"
|
||||
dest: "{{ k3s_install_dir }}/k3s-{{ k3s_release_version }}"
|
||||
checksum: "sha256:{{ k3s_hash_sum.stdout }}"
|
||||
checksum: "sha256:{{ k3s_hash_sum }}"
|
||||
mode: 0755
|
||||
|
|
Loading…
Reference in a new issue