mirror of
https://gitlab.com/s3lph/ansible-collection-prometheus
synced 2024-12-23 00:37:33 +01:00
Remove hardcoded blackbox module definitions
This commit is contained in:
parent
c25dfa6210
commit
25afa17bb1
1 changed files with 3 additions and 3 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue