Added DIUN

This commit is contained in:
Viyurz 2024-09-07 10:16:47 +02:00
parent 7f3e5857df
commit 8d6730a83e
Signed by: Viyurz
SSH key fingerprint: SHA256:IskOHTmhHSJIvAt04N6aaxd5SZCVWW1Guf9tEcxIMj8
8 changed files with 94 additions and 0 deletions

View file

@ -46,6 +46,7 @@ cifs_mounts:
projects:
- coturn
- diun
- element
- etebase
- fireshare

View file

@ -0,0 +1,9 @@
- name: Include setup tasks
include_tasks:
file: setup.yml
when: run_setup | default(false) | bool
- name: Include update tasks
include_tasks:
file: update.yml
when: run_update | default(false) | bool

View file

@ -0,0 +1,19 @@
- name: "(Re)Create {{ project_dir }} project directory"
file:
path: "{{ project_dir }}"
state: "{{ item }}"
loop:
- absent
- directory
- name: Template docker-compose.yaml, .env & images.yml to project directory
template:
src: "{{ item }}"
dest: "{{ project_dir }}/{{ item }}"
owner: "{{ host_uid }}"
group: "{{ host_uid }}"
mode: '640'
loop:
- docker-compose.yaml
- .env
- images.yml

View file

@ -0,0 +1,24 @@
- name: Pull project services
community.docker.docker_compose:
project_src: "{{ project_dir }}"
recreate: never
pull: true
debug: true
when: docker_pull_images | bool
register: diun_docker_compose_pull_result
- name: Display pulled image(s) name
set_fact:
diun_pulled_images: "{{ diun_pulled_images | default([]) + [item.pulled_image.name] }}"
loop: "{{ diun_docker_compose_pull_result['actions'] | default([]) | selectattr('pulled_image', 'defined') }}"
- name: Include backup tasks
include_tasks:
file: backup.yml
# Make a backup if we didn't already make one and we pulled a new image
when: not run_backup | default(false) and diun_pulled_images is defined
- name: Create/Restart project services
community.docker.docker_compose:
project_src: "{{ project_dir }}"
restarted: "{{ run_setup | default(false) | bool }}"

View file

@ -0,0 +1,6 @@
TZ={{ timezone }}
DIUN_WATCH_SCHEDULE='0 */6 * * *'
DIUN_PROVIDERS_DOCKER=true
DIUN_PROVIDERS_DOCKER_WATCHBYDEFAULT=true
DIUN_PROVIDERS_FILE_FILENAME=/etc/diun/images.yml
DIUN_NOTIF_DISCORD_WEBHOOKURL='{{ diun_secrets["webhookurl"] }}'

View file

@ -0,0 +1,15 @@
services:
diun:
image: docker.io/crazymax/diun:4
container_name: diun
command: serve
restart: always
env_file: .env
volumes:
- {{ docker_host | regex_replace('^unix://', '') }}:/var/run/docker.sock:ro
- ./images.yml:/etc/diun/images.yml:ro
- diun-data:/data
volumes:
diun-data:
name: diun-data

View file

@ -0,0 +1,17 @@
- name: quay.io/hedgedoc/hedgedoc
watch_repo: true
include_tags:
- ^2
- name: docker.io/stalwartlabs/mail-server
watch_repo: true
include_tags:
- ^v0\.(9|\d{2})
- ^v1
- name: docker.io/aaronleopold/stump
watch_repo: true
include_tags:
- ^0\.0\.([5-9]|\d{2})$
- ^0\.([1-9]|\d{2})
- ^1

View file

@ -11,6 +11,9 @@ cifs_credentials:
coturn_secrets:
static_auth_secret:
diun_secrets:
webhookurl:
fireshare_secrets:
admin_username:
admin_password: