Markus Katharina Brechtel пре 4 година
родитељ
комит
bcacd1bfe5
4 измењених фајлова са 43 додато и 14 уклоњено
  1. +17
    -0
      tasks/clean.yaml
  2. +2
    -14
      tasks/main.yaml
  3. +23
    -0
      tasks/setup.yaml
  4. +1
    -0
      vars/main.yaml

+ 17
- 0
tasks/clean.yaml Прегледај датотеку

@@ -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

+ 2
- 14
tasks/main.yaml Прегледај датотеку

@@ -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

+ 23
- 0
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
- 0
vars/main.yaml Прегледај датотеку

@@ -1 +1,2 @@
---
_task_deb_dl_url: "{{ _task_releases.json.assets | json_query(\"[?name=='task_linux_amd64.deb'].browser_download_url|[0]\") }}"

Loading…
Откажи
Сачувај