1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-prometheus synced 2024-10-23 03:46:59 +02:00

Fix unwanted hostvars propagation in prometheus job target loop

This commit is contained in:
s3lph 2021-01-15 21:51:23 +01:00
parent 89614cdaa2
commit 04bf2db312

View file

@ -43,7 +43,8 @@
- targets:
{% for host in groups['all'] -%}
{% if hostvars[host]['monitor_' + job.name] | default(false) | bool -%}
{%- set fstring = job.defaults | default({}) -%}
{%- set fstring = {} -%}
{%- set ignored = fstring.update(job.defaults|default({})) -%}
{%- set ignored = fstring.update(hostvars[host]) -%}
- {{ job.target_format | format(**fstring) }}
{% endif -%}