initial commit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
75891c3271
129 changed files with 8046 additions and 0 deletions
6
roles/diun/defaults/main.yml
Normal file
6
roles/diun/defaults/main.yml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
# Check schedule (cron format)
|
||||
diun_schedule: "0 */6 * * *"
|
||||
|
||||
# Notification toggles
|
||||
diun_notify_matrix: false
|
||||
7
roles/diun/handlers/main.yml
Normal file
7
roles/diun/handlers/main.yml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
- name: restart diun
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: /srv/diun
|
||||
state: present
|
||||
recreate: always
|
||||
build: never
|
||||
29
roles/diun/tasks/main.yml
Normal file
29
roles/diun/tasks/main.yml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
- name: Create diun directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
loop:
|
||||
- /srv/diun
|
||||
- /srv/diun/data
|
||||
|
||||
- name: Create diun configuration
|
||||
template:
|
||||
src: diun.yml.j2
|
||||
dest: /srv/diun/data/diun.yml
|
||||
mode: '0644'
|
||||
notify: restart diun
|
||||
|
||||
- name: Create compose file
|
||||
template:
|
||||
src: compose.yml.j2
|
||||
dest: /srv/diun/compose.yml
|
||||
mode: '0644'
|
||||
notify: restart diun
|
||||
|
||||
- name: Deploy diun
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: /srv/diun
|
||||
state: present
|
||||
build: never
|
||||
21
roles/diun/templates/compose.yml.j2
Normal file
21
roles/diun/templates/compose.yml.j2
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
services:
|
||||
diun:
|
||||
image: crazymax/diun:{{ diun_version }}
|
||||
container_name: diun
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- /srv/diun/data:/data
|
||||
environment:
|
||||
CONFIG: /data/diun.yml
|
||||
TZ: {{ timezone | default('UTC') }}
|
||||
LOG_LEVEL: info
|
||||
LOG_JSON: "true"
|
||||
labels:
|
||||
diun.enable: "false"
|
||||
networks:
|
||||
- monitoring
|
||||
|
||||
networks:
|
||||
monitoring:
|
||||
external: true
|
||||
30
roles/diun/templates/diun.yml.j2
Normal file
30
roles/diun/templates/diun.yml.j2
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
watch:
|
||||
schedule: "{{ diun_schedule | default('0 */6 * * *') }}"
|
||||
firstCheckNotif: false
|
||||
|
||||
providers:
|
||||
docker:
|
||||
watchByDefault: true
|
||||
watchStopped: false
|
||||
|
||||
{% if diun_notify_email | default(false) or diun_notify_matrix | default(false) %}
|
||||
notif:
|
||||
{% if diun_notify_email | default(false) %}
|
||||
mail:
|
||||
host: {{ mail_hostname }}
|
||||
port: 587
|
||||
ssl: false
|
||||
insecureSkipVerify: false
|
||||
username: {{ diun_email_user }}
|
||||
password: {{ diun_email_password }}
|
||||
from: {{ diun_email_user }}
|
||||
to: {{ diun_email_to }}
|
||||
{% endif %}
|
||||
{% if diun_notify_matrix | default(false) %}
|
||||
matrix:
|
||||
homeserverURL: https://{{ tuwunel_domain }}
|
||||
user: {{ diun_matrix_user }}
|
||||
password: {{ diun_matrix_password }}
|
||||
roomID: {{ diun_matrix_room_id }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue