From 2ad12c3b7e7f6f2159bec33105448e6114ffdfec Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 29 Aug 2021 22:41:57 +0200 Subject: prometheus: move blackbox job config to new setup --- roles/monitoring/prometheus/server/filter_plugins/prometheus.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'roles/monitoring/prometheus/server/filter_plugins') diff --git a/roles/monitoring/prometheus/server/filter_plugins/prometheus.py b/roles/monitoring/prometheus/server/filter_plugins/prometheus.py index 6e18481c..5a8722c2 100644 --- a/roles/monitoring/prometheus/server/filter_plugins/prometheus.py +++ b/roles/monitoring/prometheus/server/filter_plugins/prometheus.py @@ -23,9 +23,10 @@ def prometheus_special_job_targets(hostvars, jobs, targets): result = [] for job in jobs: for target in targets: - config_varname = 'prometheus_special_job_' + job + config_varname = 'prometheus_special_job_' + job.replace('-', '_') if config_varname in hostvars[target]: - result.append({'job': job, 'instance': hostvars[target][config_varname]['instance'], 'config': hostvars[target][config_varname]}) + for config in hostvars[target][config_varname]: + result.append({'job': job, 'instance': config['instance'], 'config': config}) return result except Exception as e: raise errors.AnsibleFilterError("prometheus_special_job_targets(): %s" % str(e)) -- cgit v1.2.3