1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-prometheus synced 2024-11-25 11:11:01 +01:00

dnsbl exporter: fix targets.ini

This commit is contained in:
s3lph 2020-11-22 02:09:59 +01:00
parent 1aa32f43d7
commit 6b005a99e3
2 changed files with 5 additions and 5 deletions

View file

@ -18,8 +18,6 @@
template:
src: etc/prometheus/dnsbl-exporter/targets.ini.j2
dest: /etc/prometheus/dnsbl-exporter/targets.ini
vars:
targets: "{{ hostvars.keys() | selectattr('monitor_dnsbl', 'true') }}"
notify: restart prometheus-dnsbl-exporter
- name: start and enable prometheus-dnsbl-exporter

View file

@ -1,6 +1,8 @@
{{ ansible_managed | comment }}
[targets]
{% for target in targets %}
server={{ target }}
{% endfor %}
{%- for host in hostvars.keys() %}
{%- if hostvars[host].monitor_dnsbl | default(true) %}
server={{ host }}
{%- endfor %}
{%- endfor %}