From 5f42b05b0f60f351832a8a61ba8181e091f67915 Mon Sep 17 00:00:00 2001 From: Ivan Reshetnikov Date: Thu, 14 Nov 2024 11:31:08 +0500 Subject: [PATCH] Run uptime kuma --- roles/haproxy/files/haproxy.cfg | 6 ++++++ roles/monitoring/tasks/main.yml | 1 + roles/monitoring/tasks/uptime_kuma.yml | 14 ++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 roles/monitoring/tasks/uptime_kuma.yml diff --git a/roles/haproxy/files/haproxy.cfg b/roles/haproxy/files/haproxy.cfg index e240583..c4e6eed 100644 --- a/roles/haproxy/files/haproxy.cfg +++ b/roles/haproxy/files/haproxy.cfg @@ -98,6 +98,9 @@ frontend https acl host_git hdr(host) -i git.comfycamp.space use_backend forgejo if host_git + acl host_uptime hdr(host) -i uptime.comfycamp.space + use_backend uptime_kuma if host_uptime + acl host_jellyfin hdr(host) -i jf.comfycamp.space use_backend jellyfin if host_jellyfin @@ -218,3 +221,6 @@ backend freshrss backend phoenix server s1 phoenix-1:8080 check + +backend uptime_kuma + server s1 uptime-kuma-1:3001 check diff --git a/roles/monitoring/tasks/main.yml b/roles/monitoring/tasks/main.yml index 1f0b753..4badc38 100644 --- a/roles/monitoring/tasks/main.yml +++ b/roles/monitoring/tasks/main.yml @@ -2,3 +2,4 @@ - import_tasks: grafana.yml - import_tasks: prometheus.yml - import_tasks: postgresql.yml +- import_tasks: uptime_kuma.yml diff --git a/roles/monitoring/tasks/uptime_kuma.yml b/roles/monitoring/tasks/uptime_kuma.yml new file mode 100644 index 0000000..2002f60 --- /dev/null +++ b/roles/monitoring/tasks/uptime_kuma.yml @@ -0,0 +1,14 @@ +- name: Create uptime kuma volume + become: true + community.docker.docker_volume: + name: uptime-kuma +- name: Start uptime kuma container + become: true + community.docker.docker_container: + name: uptime-kuma-1 + image: louislam/uptime-kuma:1.23.15 + volumes: + - uptime-kuma:/app/data + networks: + - name: haproxy + restart_policy: unless-stopped