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