浏览代码

deb installation

master
父节点
当前提交
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]\") }}"

正在加载...
取消
保存