configpolicy/roles/blackbox-exporter/tasks/deploy.yml

34 lines
703 B
YAML

- name: ensure /etc/prometheus directory exists
file:
path: /etc/prometheus
mode: u=rwx,go=rx
owner: root
group: root
state: directory
- name: ensure blackbox_exporter is configured
copy:
dest: /etc/prometheus/blackbox.yml
content: |
{{ blackbox_config|to_nice_yaml(indent=2) }}
mode: u=rw,go=r
owner: root
group: root
notify:
- reload blackbox_exporter
- name: ensure blackbox_exporter starts at boot
service:
name: blackbox_exporter
enabled: true
tags:
- service
- name: flush_handlers
meta: flush_handlers
- name: ensure blackbox_exporter is running
service:
name: blackbox_exporter
state: started
tags:
- service