uptime-kuma: add uptime_kuma_enabled flag and make monitoring blocks inert

Removing the credentials would otherwise break these playbooks mid-deploy: they
template uptime_kuma_password with no assert to stop them first. 100 tasks are
now guarded by uptime_kuma_enabled (false), so deployments run normally and the
monitoring sections skip. A further 28 tasks were already self-guarding on
monitor_setup/push_url being defined; verified that a skipped task's registered
variable makes those skip cleanly rather than error.

The blocks are kept on purpose — the health-check logic is the durable part and
should be rewired to whatever replaces Uptime Kuma.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
counterweight 2026-09-11 22:43:55 +02:00
parent 80c9e6f3e3
commit 2dabc6ad62
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
15 changed files with 240 additions and 0 deletions

View file

@ -206,7 +206,18 @@
# ===========================================
# Health Check Script + Systemd Timer
# ===========================================
# ═════════════════════════════════════════════════════════════════════════
# DEPRECATED — Uptime Kuma was decommissioned on 2026-09-11.
#
# Every task below is inert: uptime_kuma_enabled is false in
# group_vars/all/main.yml, so they all skip and the deployment above still
# runs normally. Kept because the health-check logic is the durable part —
# when a replacement exists, rewire the push transport and flip the flag.
#
# What was being monitored: archive/uptime_kuma/MONITORS.md
# ═════════════════════════════════════════════════════════════════════════
- name: Create DATUM Gateway health check script
when: uptime_kuma_enabled | default(false)
copy:
dest: /usr/local/bin/datum-gateway-healthcheck-push.sh
content: |
@ -287,6 +298,7 @@
daemon_reload: yes
- name: Enable and start datum-gateway health check timer
when: uptime_kuma_enabled | default(false)
systemd:
name: datum-gateway-healthcheck.timer
enabled: yes
@ -296,6 +308,7 @@
# Uptime Kuma Push Monitor Setup
# ===========================================
- name: Create Uptime Kuma push monitor setup script for DATUM Gateway
when: uptime_kuma_enabled | default(false)
delegate_to: localhost
become: no
copy:
@ -396,6 +409,7 @@
mode: "0755"
- name: Create temporary config for push monitor setup
when: uptime_kuma_enabled | default(false)
delegate_to: localhost
become: no
copy:
@ -408,6 +422,7 @@
mode: "0644"
- name: Run Uptime Kuma push monitor setup
when: uptime_kuma_enabled | default(false)
command: python3 /tmp/setup_datum_gateway_monitor.py
delegate_to: localhost
become: no
@ -421,6 +436,7 @@
when: monitor_setup.stdout is defined
- name: Read push URL from file
when: uptime_kuma_enabled | default(false)
slurp:
src: /tmp/datum_gateway_push_url.txt
delegate_to: localhost
@ -442,6 +458,7 @@
notify: Restart datum-gateway health check timer
- name: Clean up temporary files
when: uptime_kuma_enabled | default(false)
delegate_to: localhost
become: no
file:
@ -460,6 +477,7 @@
daemon_reload: yes
- name: Restart datum-gateway health check timer
when: uptime_kuma_enabled | default(false)
systemd:
name: datum-gateway-healthcheck.timer
state: restarted
@ -539,6 +557,7 @@
msg: "{{ caddy_reload.stdout_lines + caddy_reload.stderr_lines }}"
- name: Display DATUM Gateway dashboard URL
when: uptime_kuma_enabled | default(false)
debug:
msg: "DATUM Gateway dashboard: https://{{ datum_gateway_domain }}"
@ -546,6 +565,7 @@
# Uptime Kuma HTTP Monitor for Public Dashboard
# ===========================================
- name: Create Uptime Kuma HTTP monitor setup script for DATUM dashboard
when: uptime_kuma_enabled | default(false)
delegate_to: localhost
become: no
copy:
@ -621,6 +641,7 @@
mode: "0755"
- name: Create temporary config for HTTP monitor
when: uptime_kuma_enabled | default(false)
delegate_to: localhost
become: no
copy:
@ -634,6 +655,7 @@
mode: "0644"
- name: Run Uptime Kuma HTTP monitor setup
when: uptime_kuma_enabled | default(false)
command: python3 /tmp/setup_datum_http_monitor.py
delegate_to: localhost
become: no
@ -647,6 +669,7 @@
when: http_monitor_setup.stdout is defined
- name: Clean up HTTP monitor temporary files
when: uptime_kuma_enabled | default(false)
delegate_to: localhost
become: no
file:
@ -733,6 +756,7 @@
ignore_errors: yes
- name: Display public Stratum endpoint
when: uptime_kuma_enabled | default(false)
debug:
msg: "DATUM Stratum public endpoint: {{ ansible_host }}:{{ datum_gateway_stratum_port }}"
@ -740,6 +764,7 @@
# Uptime Kuma TCP Monitor for Public Stratum
# ===========================================
- name: Create Uptime Kuma TCP monitor setup script for Stratum
when: uptime_kuma_enabled | default(false)
delegate_to: localhost
become: no
copy:
@ -816,6 +841,7 @@
mode: "0755"
- name: Create temporary config for Stratum TCP monitor
when: uptime_kuma_enabled | default(false)
delegate_to: localhost
become: no
copy:
@ -830,6 +856,7 @@
mode: "0644"
- name: Run Uptime Kuma TCP monitor setup
when: uptime_kuma_enabled | default(false)
command: python3 /tmp/setup_datum_stratum_tcp_monitor.py
delegate_to: localhost
become: no
@ -843,6 +870,7 @@
when: tcp_monitor_setup.stdout is defined
- name: Clean up Stratum TCP monitor temporary files
when: uptime_kuma_enabled | default(false)
delegate_to: localhost
become: no
file: