# -*- coding: utf-8 -*- # vim: ft=yaml --- chaos-role: - prometheus-master - prometheus-node_exporter prometheus: wanted: - prometheus - node_exporter service: prometheus: args: web.listen-address: 0.0.0.0:9090 config: prometheus: scrape_configs: - job_name: 'node' static_configs: - targets: {% set roles = salt.saltutil.runner('mine.get', tgt='*', fun='chaos_roles', tgt_type='glob' ) %} {% for host,role in roles.items() %} {% if 'prometheus-node_exporter' in role %} - {{ host }}{{ salt['pillar.get']('prometheus:service:node_exporter:args:web.listen-address', ':9100') }} {% endif %} {% endfor %}