2016-12-12 07:43:05 -05:00
|
|
|
{% from "prometheus/map.jinja" import prometheus with context %}
|
|
|
|
|
|
|
|
include:
|
|
|
|
- prometheus.user
|
|
|
|
|
|
|
|
blackbox_exporter_tarball:
|
|
|
|
archive.extracted:
|
2017-01-17 10:50:15 -05:00
|
|
|
- name: {{ prometheus.exporter.blackbox.install_dir }}
|
|
|
|
- source: {{ prometheus.exporter.blackbox.source }}
|
|
|
|
- source_hash: {{ prometheus.exporter.blackbox.source_hash }}
|
2017-01-17 10:09:06 -05:00
|
|
|
- user: {{ prometheus.user }}
|
|
|
|
- group: {{ prometheus.group }}
|
2016-12-12 07:43:05 -05:00
|
|
|
- archive_format: tar
|
2017-01-17 10:09:06 -05:00
|
|
|
- if_missing: {{ prometheus.exporter.blackbox.version_path }}
|
2016-12-12 07:43:05 -05:00
|
|
|
|
2019-05-08 17:52:27 -04:00
|
|
|
{#
|
2016-12-12 07:43:05 -05:00
|
|
|
blackbox_exporter_bin_link:
|
|
|
|
file.symlink:
|
|
|
|
- name: /usr/bin/blackbox_exporter
|
2017-01-17 10:09:06 -05:00
|
|
|
- target: {{ prometheus.exporter.blackbox.version_path }}/blackbox_exporter
|
2016-12-12 07:43:05 -05:00
|
|
|
- require:
|
|
|
|
- archive: blackbox_exporter_tarball
|
2019-05-08 17:52:27 -04:00
|
|
|
#}
|
2016-12-12 07:43:05 -05:00
|
|
|
|
|
|
|
blackbox_exporter_defaults:
|
|
|
|
file.managed:
|
|
|
|
- name: /etc/default/blackbox_exporter
|
2019-05-08 17:59:42 -04:00
|
|
|
- source: salt://prometheus/files/default-blackbox_exporter.jinja
|
2016-12-12 07:43:05 -05:00
|
|
|
- template: jinja
|
|
|
|
- defaults:
|
2017-01-17 10:50:15 -05:00
|
|
|
config_file: {{ prometheus.exporter.blackbox.args.config_file }}
|
2016-12-12 07:43:05 -05:00
|
|
|
|
|
|
|
blackbox_exporter_service_unit:
|
|
|
|
file.managed:
|
|
|
|
{%- if grains.get('init') == 'systemd' %}
|
|
|
|
- name: /etc/systemd/system/blackbox_exporter.service
|
2019-05-08 17:59:42 -04:00
|
|
|
- source: salt://prometheus/files/exporter.systemd.jinja
|
2016-12-12 07:43:05 -05:00
|
|
|
{%- elif grains.get('init') == 'upstart' %}
|
|
|
|
- name: /etc/init/blackbox_exporter.conf
|
2019-05-08 17:59:42 -04:00
|
|
|
- source: salt://prometheus/files/exporter.upstart.jinja
|
2016-12-12 07:43:05 -05:00
|
|
|
{%- endif %}
|
2019-05-08 20:34:24 -04:00
|
|
|
- template: jinja
|
|
|
|
- defaults:
|
2019-05-08 16:09:25 -04:00
|
|
|
svc: node_exporter
|
|
|
|
user: {{ prometheus.user }}
|
|
|
|
group: {{ prometheus.group }}
|
|
|
|
bin_path: {{ prometheus.exporter.node.version_path }}
|
|
|
|
args: {{ prometheus.exporter.get('args', []) }}
|
2016-12-12 07:43:05 -05:00
|
|
|
- require_in:
|
|
|
|
- file: blackbox_exporter_service
|
|
|
|
|
|
|
|
blackbox_exporter_service:
|
|
|
|
service.running:
|
|
|
|
- name: blackbox_exporter
|
|
|
|
- enable: True
|
|
|
|
- reload: True
|
|
|
|
- watch:
|
2017-01-17 10:09:06 -05:00
|
|
|
- file: blackbox_exporter_service_unit
|
2016-12-12 07:43:05 -05:00
|
|
|
- file: blackbox_exporter_defaults
|
2019-05-08 17:52:27 -04:00
|
|
|
{# - file: blackbox_exporter_bin_link #}
|