diff options
Diffstat (limited to 'roles/monitoring/prometheus/server/filter_plugins/prometheus.py')
-rw-r--r-- | roles/monitoring/prometheus/server/filter_plugins/prometheus.py | 5 |
1 files changed, 3 insertions, 2 deletions
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)) |