Fixes
This commit is contained in:
parent
9b8494b33b
commit
dd8f45246f
4 changed files with 29 additions and 12 deletions
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
diun_user: duin
|
diun_user: duin
|
||||||
diun_github_api_url: https://api.github.com/repos/crazy-max/diun/releases/latest
|
diun_github_api_url: https://api.github.com/repos/crazy-max/diun/releases/latest
|
||||||
duin_home: /var/lib/duin
|
diun_home: /var/lib/duin
|
||||||
diun_binary_path: /usr/local/bin
|
diun_binary_path: /usr/local/bin
|
||||||
duin_configuration_path: /etc/diun
|
diun_configuration_path: /etc/diun
|
||||||
duin_configuration_file: diun.yaml
|
diun_configuration_file: diun.yaml
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
---
|
---
|
||||||
|
- name: "Create group"
|
||||||
|
ansible.builtin.group:
|
||||||
|
name: "{{ diun_user }}"
|
||||||
|
state: present
|
||||||
|
system: true
|
||||||
|
|
||||||
- name: "Create user"
|
- name: "Create user"
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ diun_user }}"
|
name: "{{ diun_user }}"
|
||||||
|
@ -10,21 +16,25 @@
|
||||||
|
|
||||||
- name: "Get download URL"
|
- name: "Get download URL"
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: curl -sL "{{ diun_github_api_url }}" | jq '.assets[] | select(.name|match("linux_amd64.tar.gz$")) | .browser_download_url'"
|
cmd: curl -sL "{{ diun_github_api_url }}" | jq -r '.assets[] | select(.name|match("linux_amd64.tar.gz$")) | .browser_download_url'
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: download_url
|
register: download_url
|
||||||
|
|
||||||
- name: "Unarchive binary"
|
- name: "Unarchive binary"
|
||||||
ansible.builtin.unarchive:
|
ansible.builtin.unarchive:
|
||||||
src: download_url.stdout
|
src: "{{ download_url.stdout }}"
|
||||||
dest: "{{ diun_binary_path }}"
|
dest: "{{ diun_binary_path }}"
|
||||||
include:
|
remote_src: true
|
||||||
- diun
|
include: diun
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
extra_opts:
|
||||||
|
- "--strip=1"
|
||||||
|
- "--no-anchored"
|
||||||
|
|
||||||
- name: "Create directories"
|
- name: "Create directories"
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
owner: "{{ diun_user }}"
|
owner: "{{ diun_user }}"
|
||||||
group: "{{ diun_user }}"
|
group: "{{ diun_user }}"
|
||||||
mode: 0750
|
mode: 0750
|
||||||
|
@ -43,7 +53,7 @@
|
||||||
src: diun.service
|
src: diun.service
|
||||||
dest: /etc/systemd/system/
|
dest: /etc/systemd/system/
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: restart duin
|
notify: restart diun
|
||||||
|
|
||||||
- name: "Enable service"
|
- name: "Enable service"
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
|
|
|
@ -11,7 +11,7 @@ RestartSec=2s
|
||||||
Type=simple
|
Type=simple
|
||||||
User={{ diun_user }}
|
User={{ diun_user }}
|
||||||
Group={{ diun_user }}
|
Group={{ diun_user }}
|
||||||
ExecStart={{ diun_binary_path }}/diun serve --config {{ duin_configuration_path }}/{{ duin_configuration_file }} --log-level info
|
ExecStart={{ diun_binary_path }}/diun serve --config {{ diun_configuration_path }}/{{ diun_configuration_file }} --log-level info
|
||||||
Restart=always
|
Restart=always
|
||||||
Environment=DIUN_DB_PATH={{ diun_home }}/diun.db
|
Environment=DIUN_DB_PATH={{ diun_home }}/diun.db
|
||||||
|
|
||||||
|
|
|
@ -4,15 +4,22 @@ db:
|
||||||
path: {{ diun_home }}/diun.db
|
path: {{ diun_home }}/diun.db
|
||||||
|
|
||||||
{% if diun_watch is defined %}
|
{% if diun_watch is defined %}
|
||||||
{{ duin_watch }}
|
watch:
|
||||||
|
{{ diun_watch.config | indent(2) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if diun_notif is defined %}
|
{% if diun_notif is defined %}
|
||||||
notif:
|
notif:
|
||||||
{{ duin_notif | indent(2, false) }}
|
{% for name in diun_notif %}
|
||||||
|
{{ name.name }}:
|
||||||
|
{{ name.config | indent(4) }}
|
||||||
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if diun_providers is defined %}
|
{% if diun_providers is defined %}
|
||||||
providers:
|
providers:
|
||||||
{{ duin_providers | indent(2, false) }}
|
{% for name in diun_providers %}
|
||||||
|
{{ name.name }}:
|
||||||
|
{{ name.config | indent(4) }}
|
||||||
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue