summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2023-02-06 20:18:51 +0100
committerChristian Pointner <equinox@spreadspace.org>2023-02-06 20:18:51 +0100
commit423cf1de5f49e98676e369d897e6320e82270fce (patch)
tree0fcf15f3b38115e9d805a691b938b491ad3250a4 /roles/monitoring/prometheus
parentprometheus targets: some more refactoring - still not working... :( (diff)
prometheus targets: fix template generation
Diffstat (limited to 'roles/monitoring/prometheus')
-rw-r--r--roles/monitoring/prometheus/exporter/register/filter_plugins/prometheus.py2
-rw-r--r--roles/monitoring/prometheus/exporter/register/tasks/main.yml2
2 files changed, 2 insertions, 2 deletions
diff --git a/roles/monitoring/prometheus/exporter/register/filter_plugins/prometheus.py b/roles/monitoring/prometheus/exporter/register/filter_plugins/prometheus.py
index c29bce81..e8067a72 100644
--- a/roles/monitoring/prometheus/exporter/register/filter_plugins/prometheus.py
+++ b/roles/monitoring/prometheus/exporter/register/filter_plugins/prometheus.py
@@ -6,7 +6,7 @@ from functools import partial
from ansible import errors
-def prometheus_job_targets(vars, jobs):
+def prometheus_job_targets(jobs, vars):
try:
result = []
for job in jobs:
diff --git a/roles/monitoring/prometheus/exporter/register/tasks/main.yml b/roles/monitoring/prometheus/exporter/register/tasks/main.yml
index efb24a0f..5627add2 100644
--- a/roles/monitoring/prometheus/exporter/register/tasks/main.yml
+++ b/roles/monitoring/prometheus/exporter/register/tasks/main.yml
@@ -42,7 +42,7 @@
- name: enable/disable job targets
vars:
- job_targets: "{{ vars | prometheus_job_targets(prometheus_server_jobs) }}"
+ job_targets: "{{ prometheus_server_jobs | prometheus_job_targets(hostvars[inventory_hostname]) }}"
block:
- name: install files for enabled targets
loop: "{{ job_targets | selectattr('enabled') }}"