1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-prometheus synced 2024-10-23 11:56:59 +02:00
ansible-collection-prometheus/roles/prometheus/tasks/blackbox.yml

22 lines
709 B
YAML
Raw Normal View History

2020-11-13 10:36:46 +01:00
---
- name: initialize list of blackbox modules
set_fact:
_blackbox_modules: {}
- name: build list of blackbox modules
set_fact:
_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 }}"
2020-11-13 10:36:46 +01:00
- 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 }}"
2020-11-13 10:36:46 +01:00
notify: restart blackbox exporter