1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-prometheus synced 2024-11-22 09:41: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: template:
src: etc/prometheus/dnsbl-exporter/targets.ini.j2 src: etc/prometheus/dnsbl-exporter/targets.ini.j2
dest: /etc/prometheus/dnsbl-exporter/targets.ini dest: /etc/prometheus/dnsbl-exporter/targets.ini
vars:
targets: "{{ hostvars.keys() | selectattr('monitor_dnsbl', 'true') }}"
notify: restart prometheus-dnsbl-exporter notify: restart prometheus-dnsbl-exporter
- name: start and enable prometheus-dnsbl-exporter - name: start and enable prometheus-dnsbl-exporter

View file

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