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

Remove hardcoded blackbox module definitions

This commit is contained in:
s3lph 2021-10-09 03:40:36 +02:00
parent c25dfa6210
commit 25afa17bb1

View file

@ -2,12 +2,12 @@
- name: initialize list of blackbox modules
set_fact:
_blackbox_modules: []
_blackbox_modules: {}
- name: build list of blackbox modules
set_fact:
_blackbox_modules: "{{ _blackbox_modules.update(item) }}"
loop: "{{ hostvars[inventory_hostname] | dict2items | selectattr('key', 'match', '^prometheus_job_.+$') | map(attribute='value') | map(attribute='blackbox') | map(attribute='modules') | filter('present') | dict }}"
_blackbox_modules: "{% set _ = _blackbox_modules.update(item) %}{{ _blackbox_modules }}"
loop: "{{ hostvars[inventory_hostname] | dict2items | selectattr('key', 'match', '^prometheus_job_.+$') | map(attribute='value') | map(attribute='blackbox') | map(attribute='modules') | select('defined') | list }}"
- name: render blackbox exporter configuration
template: