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

@ -226,7 +226,18 @@
delay: 5
ignore_errors: yes
# ═════════════════════════════════════════════════════════════════════════
# 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: Display deployment status
when: uptime_kuma_enabled | default(false)
debug:
msg:
- "Mempool deployment complete!"
@ -239,6 +250,7 @@
# Health Check Scripts for Uptime Kuma Push Monitors
# ===========================================
- name: Create Mempool MariaDB health check script
when: uptime_kuma_enabled | default(false)
copy:
dest: /usr/local/bin/mempool-mariadb-healthcheck-push.sh
content: |
@ -273,6 +285,7 @@
mode: '0755'
- name: Create Mempool backend health check script
when: uptime_kuma_enabled | default(false)
copy:
dest: /usr/local/bin/mempool-backend-healthcheck-push.sh
content: |
@ -307,6 +320,7 @@
mode: '0755'
- name: Create Mempool frontend health check script
when: uptime_kuma_enabled | default(false)
copy:
dest: /usr/local/bin/mempool-frontend-healthcheck-push.sh
content: |
@ -396,6 +410,7 @@
daemon_reload: yes
- name: Enable and start health check timers
when: uptime_kuma_enabled | default(false)
systemd:
name: "mempool-{{ item }}-healthcheck.timer"
enabled: yes
@ -409,6 +424,7 @@
# Uptime Kuma Push Monitor Setup
# ===========================================
- name: Create Uptime Kuma push monitor setup script for Mempool
when: uptime_kuma_enabled | default(false)
delegate_to: localhost
become: no
copy:
@ -492,6 +508,7 @@
mode: '0755'
- name: Create temporary config for monitor setup
when: uptime_kuma_enabled | default(false)
delegate_to: localhost
become: no
copy:
@ -507,6 +524,7 @@
mode: '0644'
- name: Run Uptime Kuma push monitor setup
when: uptime_kuma_enabled | default(false)
command: python3 /tmp/setup_mempool_monitors.py
delegate_to: localhost
become: no
@ -520,6 +538,7 @@
when: monitor_setup.stdout is defined
- name: Read push URLs from file
when: uptime_kuma_enabled | default(false)
slurp:
src: /tmp/mempool_push_urls.yml
delegate_to: localhost
@ -573,6 +592,7 @@
when: push_urls is defined
- name: Clean up temporary files
when: uptime_kuma_enabled | default(false)
delegate_to: localhost
become: no
file:
@ -637,6 +657,7 @@
state: reloaded
- name: Display Mempool URL
when: uptime_kuma_enabled | default(false)
debug:
msg: "Mempool is now available at https://{{ mempool_domain }}"
@ -644,6 +665,7 @@
# Uptime Kuma HTTP Monitor for Public Endpoint
# ===========================================
- name: Create Uptime Kuma HTTP monitor setup script for Mempool
when: uptime_kuma_enabled | default(false)
delegate_to: localhost
become: no
copy:
@ -714,6 +736,7 @@
mode: '0755'
- name: Create temporary config for HTTP monitor setup
when: uptime_kuma_enabled | default(false)
delegate_to: localhost
become: no
copy:
@ -727,6 +750,7 @@
mode: '0644'
- name: Run Uptime Kuma HTTP monitor setup
when: uptime_kuma_enabled | default(false)
command: python3 /tmp/setup_mempool_http_monitor.py
delegate_to: localhost
become: no
@ -740,6 +764,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: