Skip to content

Commit ef031d5

Browse files
committed
fix: restore host disk alerts validation in main.yml and remove redundant check from alerting.yml
1 parent 19ff95a commit ef031d5

2 files changed

Lines changed: 16 additions & 13 deletions

File tree

roles/horde_monitoring/tasks/alerting.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,9 @@
44
#
55
# The rendered rules file is placed in the Prometheus rules directory where
66
# it is automatically loaded by Prometheus via the rule_files glob.
7-
8-
- name: Fail when host disk alerts are enabled without host filesystem metrics
9-
ansible.builtin.fail:
10-
msg: >-
11-
horde_monitoring_install_host_disk_alerts=true requires
12-
node_filesystem_* metrics in Prometheus.
13-
Set horde_monitoring_host_filesystem_metrics_available=true only when
14-
host filesystem metrics are actually ingested (node_exporter or Alloy),
15-
or disable host disk alerts with horde_monitoring_install_host_disk_alerts=false.
16-
when:
17-
- horde_monitoring_start_services | bool
18-
- horde_monitoring_install_host_disk_alerts | default(true) | bool
19-
- not (horde_monitoring_host_filesystem_metrics_available | default(false) | bool)
7+
# NOTE: the host-filesystem metrics prerequisite guard lives in tasks/main.yml
8+
# (before any include_tasks) so it fires as a true pre-flight check regardless
9+
# of which backends are being installed.
2010

2111
- name: Probe Prometheus targets for postgres job (when postgres alerts enabled)
2212
ansible.builtin.uri:

roles/horde_monitoring/tasks/main.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
# using the prometheus.prometheus.prometheus community role.
66

77
# ── Flag-combination validation ────────────────────────────
8+
- name: Fail when host disk alerts are enabled without host filesystem metrics
9+
ansible.builtin.fail:
10+
msg: >-
11+
horde_monitoring_install_host_disk_alerts=true requires
12+
node_filesystem_* metrics in Prometheus.
13+
Set horde_monitoring_host_filesystem_metrics_available=true only when
14+
host filesystem metrics are actually ingested (node_exporter or Alloy),
15+
or disable host disk alerts with horde_monitoring_install_host_disk_alerts=false.
16+
when:
17+
- horde_monitoring_start_services | bool
18+
- horde_monitoring_install_host_disk_alerts | default(true) | bool
19+
- not (horde_monitoring_host_filesystem_metrics_available | default(false) | bool)
20+
821
- name: Warn when backup is enabled but S3 storage is disabled
922
ansible.builtin.debug:
1023
msg: >-

0 commit comments

Comments
 (0)