Download crun using download_file.yml (#7370)

* Add crun download_url and checksum

* Change versioning format to crun native versioning

* Download crun using download_file.yml

* Get crun version from download defaults

* Delegate crun binary copy task to crun role
This commit is contained in:
Necatican Yıldırım
2021-03-19 18:40:33 +03:00
committed by GitHub
parent ead8a4e4de
commit 811f546ea6
3 changed files with 36 additions and 23 deletions

View File

@@ -1,5 +1,3 @@
---
crun_version: 0.18
crun_release_url: https://github.com/containers/crun/releases/download/{{ crun_version }}/crun-{{ crun_version }}-linux-{{ host_architecture }}
crun_bin_dir: /usr/bin/

View File

@@ -1,24 +1,12 @@
---
- name: crun | Download crun binary
include_tasks: "../../../download/tasks/download_file.yml"
vars:
download: "{{ download_defaults | combine(downloads.crun) }}"
- name: Create binary destination folder
file:
mode: '0755'
state: directory
path: "{{ crun_bin_dir }}"
- name: Check if binary exists
stat:
path: "{{ crun_bin_dir }}/crun"
get_attributes: no
get_checksum: no
get_mime: no
register: crun_stat
# TODO: use download_file.yml
- name: Download binary
get_url:
url: "{{ crun_release_url }}"
- name: Copy crun binary from download dir
copy:
src: "{{ local_release_dir }}/crun"
dest: "{{ crun_bin_dir }}/crun"
mode: '0755'
when: not crun_stat.stat.exists
environment: "{{ proxy_env }}"
mode: 0755
remote_src: true