Added DIUN
This commit is contained in:
parent
7f3e5857df
commit
8d6730a83e
8 changed files with 94 additions and 0 deletions
1
env.yml
1
env.yml
|
@ -46,6 +46,7 @@ cifs_mounts:
|
|||
|
||||
projects:
|
||||
- coturn
|
||||
- diun
|
||||
- element
|
||||
- etebase
|
||||
- fireshare
|
||||
|
|
9
roles/diun/tasks/main.yml
Normal file
9
roles/diun/tasks/main.yml
Normal 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
|
19
roles/diun/tasks/setup.yml
Normal file
19
roles/diun/tasks/setup.yml
Normal 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
|
24
roles/diun/tasks/update.yml
Normal file
24
roles/diun/tasks/update.yml
Normal 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 }}"
|
6
roles/diun/templates/.env
Normal file
6
roles/diun/templates/.env
Normal 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"] }}'
|
15
roles/diun/templates/docker-compose.yaml
Normal file
15
roles/diun/templates/docker-compose.yaml
Normal 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
|
17
roles/diun/templates/images.yml
Normal file
17
roles/diun/templates/images.yml
Normal 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
|
|
@ -11,6 +11,9 @@ cifs_credentials:
|
|||
coturn_secrets:
|
||||
static_auth_secret:
|
||||
|
||||
diun_secrets:
|
||||
webhookurl:
|
||||
|
||||
fireshare_secrets:
|
||||
admin_username:
|
||||
admin_password:
|
||||
|
|
Loading…
Reference in a new issue