From cc2ba9ff7b92031777ec9910b6e53954f22e792c Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Fri, 31 Dec 2021 14:43:47 +0100 Subject: [PATCH] prometheus: deploy targets_ipmi.json --- playbooks/prometheus.yml | 18 ++++++++++++++++++ roles/prometheus/tasks/main.yml | 7 +++++++ 2 files changed, 25 insertions(+) diff --git a/playbooks/prometheus.yml b/playbooks/prometheus.yml index 9be7fb6..fe4be29 100755 --- a/playbooks/prometheus.yml +++ b/playbooks/prometheus.yml @@ -14,6 +14,9 @@ {{ groups['fleming_pve'] + groups['fleming_vm'] | list | sort }} prometheus_unifi_snmp_targets: - targets: "{{ groups['fleming_unifi'] | list | sort }}" + prometheus_ipmi_targets: + - targets: | + {{ groups['fleming_pve'] + groups['fleming_server'] | list | sort }} update_motd: prometheus: >- Prometheus (en configuration fleming) est déployé (/etc/prometheus). @@ -38,6 +41,9 @@ prometheus_ups_snmp_targets: - ups-pn-1.ups.auro.re - ups-ps-1.ups.auro.re + prometheus_ipmi_targets: + - targets: | + {{ groups['pacaterie_pve'] | list | sort }} update_motd: prometheus: >- Prometheus (en configuration pacaterie) est déployé (/etc/prometheus). @@ -64,6 +70,9 @@ {{ groups['edc_pve'] + groups['edc_vm'] + groups['edc_server'] | list | sort }} prometheus_unifi_snmp_targets: - targets: "{{ groups['edc_unifi'] | list | sort }}" + prometheus_ipmi_targets: + - targets: | + {{ groups['edc_pve'] + groups['edc_server'] | list | sort }} update_motd: prometheus: >- Prometheus (en configuration edc) est déployé (/etc/prometheus). @@ -89,6 +98,9 @@ - ups-gk-1.ups.auro.re prometheus_pdu_snmp_targets: - pdu-ga-1.ups.auro.re + prometheus_ipmi_targets: + - targets: | + {{ groups['gs_pve'] | list | sort }} update_motd: prometheus: >- Prometheus (en configuration gs) est déployé (/etc/prometheus). @@ -114,6 +126,9 @@ {{ groups['rives_pve'] + groups['rives_vm'] | list | sort }} prometheus_unifi_snmp_targets: - targets: "{{ groups['rives_unifi'] | list | sort }}" + prometheus_ipmi_targets: + - targets: | + {{ groups['rives_pve'] | list | sort }} update_motd: prometheus: >- Prometheus (en configuration rives) est déployé (/etc/prometheus). @@ -152,6 +167,9 @@ - sw-ec-core.switch.auro.re - sw-gk-core.switch.auro.re - sw-r3-core.switch.auro.re + prometheus_ipmi_targets: + - targets: | + {{ groups['aurore_pve'] | list | sort }} update_motd: prometheus: >- Prometheus (en configuration aurore) est déployé (/etc/prometheus). diff --git a/roles/prometheus/tasks/main.yml b/roles/prometheus/tasks/main.yml index e7dd24d..284fa8b 100644 --- a/roles/prometheus/tasks/main.yml +++ b/roles/prometheus/tasks/main.yml @@ -113,6 +113,13 @@ mode: 0644 when: prometheus_pdu_snmp_targets is defined +- name: Configure Prometheus ipmi targets monitoring + copy: + content: "{{ prometheus_ipmi_targets | to_nice_json }}\n" + dest: /etc/prometheus/targets_ipmi.json + mode: 0644 + when: prometheus_ipmi_targets is defined + - name: Activate prometheus service systemd: name: prometheus