- targets: [ '{{ (target.instance == prometheus_server) | ternary('127.0.0.1:9999', hostvars[target.instance].prometheus_scrape_endpoint) }}' ] labels: instance: '{{ target.instance }}' {% for name, value in prometheus_target_labels.items() %} {{ name }}: '{{ value }}' {% endfor %}