Updated defaults and parsing

This commit is contained in:
Eric Renfro 2019-05-08 20:34:24 -04:00
parent ba53500166
commit 1eb05539f2
Signed by: psi-jack
GPG key ID: 14977F3A50D9A5BF
6 changed files with 19 additions and 9 deletions

View file

@ -25,11 +25,14 @@ prometheus:
install_dir: /opt
source: https://github.com/prometheus/node_exporter/releases/download/v0.17.0/node_exporter-0.17.0.linux-amd64.tar.gz
source_hash: https://github.com/prometheus/node_exporter/releases/download/v0.17.0/sha256sums.txt
url: ""
args: []
blackbox:
version: 0.14.0.linux-amd64
install_dir: /opt
source: https://github.com/prometheus/blackbox_exporter/releases/download/v0.14.0/blackbox_exporter-0.14.0.linux-amd64.tar.gz
source_hash: https://github.com/prometheus/blackbox_exporter/releases/download/v0.14.0/sha256sums.txt
url: ""
args:
config_file: /etc/prometheus/blackbox_exporter.yml
haproxy:
@ -37,6 +40,7 @@ prometheus:
install_dir: /opt
source: https://github.com/prometheus/haproxy_exporter/releases/download/v0.10.0/haproxy_exporter-0.10.0.linux-amd64.tar.gz
source_hash: https://github.com/prometheus/haproxy_exporter/releases/download/v0.10.0/sha256sums.txt
url: ""
args:
scrape_uri: 'unix:/run/haproxy/admin.sock'
rabbitmq:
@ -44,3 +48,5 @@ prometheus:
install_dir: /opt
source: https://github.com/kbudde/rabbitmq_exporter/releases/download/v0.24.0/rabbitmq_exporter-0.24.0.linux-amd64.tar.gz
source_hash: sha256=dbbd44a5a4b4a22ba338b9732c014587bc11513a5d6d2e3e519fc313b1cc46d4
url: ""
args: []

View file

@ -39,7 +39,8 @@ blackbox_exporter_service_unit:
- name: /etc/init/blackbox_exporter.conf
- source: salt://prometheus/files/exporter.upstart.jinja
{%- endif %}
- context:
- template: jinja
- defaults:
svc: node_exporter
user: {{ prometheus.user }}
group: {{ prometheus.group }}

View file

@ -44,8 +44,9 @@ haproxy_exporter_service_unit:
svc: node_exporter
user: {{ prometheus.user }}
group: {{ prometheus.group }}
bin_path: {{ prometheus.exporter.node.version_path }}
args: {{ prometheus.exporter.get('args', []) }}
bin_path: {{ prometheus.exporter.haproxy.version_path }}
args: {{ prometheus.exporter.haproxy.args }}
url: {{ prometheus.exporter.haproxy.url }}
- require_in:
- file: haproxy_exporter_service

View file

@ -43,8 +43,8 @@ node_exporter_service_unit:
user: {{ prometheus.user }}
group: {{ prometheus.group }}
bin_path: {{ prometheus.exporter.node.version_path }}
args: {{ prometheus.exporter.node.get('args', []) }}
url: {{ prometheus.exporter.node.get('url', None) }}
args: {{ prometheus.exporter.node.args }}
url: {{ prometheus.exporter.node.url }}
- require_in:
- file: node_exporter_service

View file

@ -37,12 +37,14 @@ rabbitmq_exporter_service_unit:
- name: /etc/init/rabbitmq_exporter.conf
- source: salt://prometheus/files/exporter.upstart.jinja
{%- endif %}
- context:
- template: jinja
- defaults:
svc: node_exporter
user: {{ prometheus.user }}
group: {{ prometheus.group }}
bin_path: {{ prometheus.exporter.node.version_path }}
args: {{ prometheus.exporter.get('args', []) }}
bin_path: {{ prometheus.exporter.rabbitmq.version_path }}
args: {{ prometheus.exporter.rabbitmq.args }}
url: {{ prometheus.exporter.rabbitmq.url }}
- require_in:
- file: rabbitmq_exporter_service

View file

@ -1,6 +1,6 @@
[Unit]
Description=Prometheus {{ svc }} Exporter
{%- if url is string and url is not None %}
{%- if url %}
Documentation={{ url }}
{%- endif %}
Wants=basic.target