mirror of
https://gitlab.com/s3lph/ansible-collection-prometheus
synced 2024-10-23 11:56:59 +02:00
21 lines
678 B
YAML
21 lines
678 B
YAML
---
|
|
|
|
- name: initialize list of blackbox modules
|
|
set_fact:
|
|
_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 }}"
|
|
|
|
- name: render blackbox exporter configuration
|
|
template:
|
|
src: blackbox.yml
|
|
dest: /etc/prometheus/blackbox.yml
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
vars:
|
|
blackbox_modules: "{{ _blackbox_modules }}"
|
|
notify: restart blackbox exporter
|