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:
parent
80c9e6f3e3
commit
2dabc6ad62
15 changed files with 240 additions and 0 deletions
|
|
@ -147,7 +147,18 @@
|
|||
register: runner_active
|
||||
changed_when: false
|
||||
|
||||
# ═════════════════════════════════════════════════════════════════════════
|
||||
# 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: Assert runner is running
|
||||
when: uptime_kuma_enabled | default(false)
|
||||
assert:
|
||||
that:
|
||||
- runner_active.stdout == "active"
|
||||
|
|
@ -155,6 +166,7 @@
|
|||
|
||||
# ── 10. Set up Uptime Kuma push monitor ────────────────────────────
|
||||
- name: Create Uptime Kuma push monitor setup script
|
||||
when: uptime_kuma_enabled | default(false)
|
||||
copy:
|
||||
dest: /tmp/setup_forgejo_runner_monitor.py
|
||||
content: |
|
||||
|
|
@ -238,6 +250,7 @@
|
|||
become: no
|
||||
|
||||
- name: Run Uptime Kuma push monitor setup
|
||||
when: uptime_kuma_enabled | default(false)
|
||||
command: >
|
||||
{{ ansible_playbook_python }}
|
||||
/tmp/setup_forgejo_runner_monitor.py
|
||||
|
|
@ -256,10 +269,12 @@
|
|||
changed_when: false
|
||||
|
||||
- name: Parse monitor setup result
|
||||
when: uptime_kuma_enabled | default(false)
|
||||
set_fact:
|
||||
monitor_info_parsed: "{{ monitor_setup_result.stdout | from_json }}"
|
||||
|
||||
- name: Set push URL
|
||||
when: uptime_kuma_enabled | default(false)
|
||||
set_fact:
|
||||
uptime_kuma_push_url: "{{ uptime_kuma_api_url }}/api/push/{{ monitor_info_parsed.push_token }}"
|
||||
|
||||
|
|
@ -272,6 +287,7 @@
|
|||
mode: '0755'
|
||||
|
||||
- name: Create forgejo-runner healthcheck script
|
||||
when: uptime_kuma_enabled | default(false)
|
||||
copy:
|
||||
dest: "{{ healthcheck_script_path }}"
|
||||
content: |
|
||||
|
|
@ -385,6 +401,7 @@
|
|||
Timeout: {{ healthcheck_timeout_seconds }}s
|
||||
|
||||
- name: Clean up temporary monitor setup script
|
||||
when: uptime_kuma_enabled | default(false)
|
||||
file:
|
||||
path: /tmp/setup_forgejo_runner_monitor.py
|
||||
state: absent
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue