@@ -0,0 +1,17 @@ | |||||
--- | |||||
- name: check if task snap binary is present | |||||
stat: | |||||
path: /snap/bin/task | |||||
register: _task_snap | |||||
- name: make sure task snap is absent | |||||
snap: | |||||
name: task | |||||
state: absent | |||||
when: _task_snap.stat.exists | |||||
- name: make sure task binary link is absent | |||||
file: | |||||
path: /usr/local/bin/ask | |||||
state: absent |
@@ -1,16 +1,4 @@ | |||||
--- | --- | ||||
- name: snapd | |||||
apt: | |||||
pkg: snapd | |||||
- name: task snap | |||||
snap: | |||||
name: task | |||||
classic: true | |||||
- name: link task binary | |||||
file: | |||||
src: /snap/bin/task | |||||
dest: /usr/local/bin/task | |||||
state: link | |||||
- import_tasks: clean.yaml | |||||
- import_tasks: setup.yaml |
@@ -0,0 +1,23 @@ | |||||
--- | |||||
- name: installation directory | |||||
file: | |||||
path: /opt/go-task | |||||
state: directory | |||||
- name: get go-task/task releases | |||||
uri: | |||||
url: https://api.github.com/repos/go-task/task/releases/latest | |||||
return_content: true | |||||
register: _task_releases | |||||
- name: download latest release deb | |||||
get_url: | |||||
url: "{{_task_deb_dl_url}}" | |||||
dest: /opt/go-task/task_linux_amd64.deb | |||||
register: _task_deb_get_url | |||||
- name: install task deb | |||||
apt: | |||||
deb: /opt/go-task/task_linux_amd64.deb | |||||
when: _task_deb_get_url.changed |
@@ -1 +1,2 @@ | |||||
--- | --- | ||||
_task_deb_dl_url: "{{ _task_releases.json.assets | json_query(\"[?name=='task_linux_amd64.deb'].browser_download_url|[0]\") }}" |