mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-10 06:14:13 +00:00
feature: Make config installation dir configurable (#173)
* feature: Make config installation dir configurable Signed-off-by: Thomas Venieris <thomas.venieris@gmail.com> * fix: blackbox_exporter_config_dir consistent - Made blackbox_exporter_config_dir parameter consistent with other collection roles - Added new parameter to meta/argument_specs.yml Signed-off-by: Thomas Venieris <thomas.venieris@gmail.com> --------- Signed-off-by: Thomas Venieris <thomas.venieris@gmail.com>
This commit is contained in:
parent
603aa0c46a
commit
791b9b1290
4 changed files with 8 additions and 2 deletions
|
@ -68,3 +68,6 @@ blackbox_exporter_configuration_modules:
|
|||
# preferred_ip_protocol: ip6
|
||||
# validate_answer_rrs:
|
||||
# fail_if_matches_regexp: [test]
|
||||
|
||||
# Where to put the blackbox_exporter.yml main configuration file
|
||||
blackbox_exporter_config_dir: /etc
|
||||
|
|
|
@ -34,3 +34,6 @@ argument_specs:
|
|||
http:
|
||||
method: GET
|
||||
valid_status_codes: []
|
||||
blackbox_exporter_config_dir:
|
||||
description: "Directory where the blackbox exporter configuration file is placed"
|
||||
default: "/etc"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
- name: Configure blackbox exporter
|
||||
ansible.builtin.template:
|
||||
src: blackbox_exporter.yml.j2
|
||||
dest: /etc/blackbox_exporter.yml
|
||||
dest: "{{ blackbox_exporter_config_dir }}/blackbox_exporter.yml"
|
||||
owner: root
|
||||
group: "{{ blackbox_exporter_group }}"
|
||||
mode: 0644
|
||||
|
|
|
@ -12,7 +12,7 @@ Group={{ blackbox_exporter_group }}
|
|||
PermissionsStartOnly=true
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
ExecStart=/usr/local/bin/blackbox_exporter \
|
||||
--config.file=/etc/blackbox_exporter.yml \
|
||||
--config.file={{ blackbox_exporter_config_dir }}/blackbox_exporter.yml \
|
||||
{% for flag, flag_value in blackbox_exporter_cli_flags.items() -%}
|
||||
--{{ flag }}={{ flag_value }} \
|
||||
{% endfor -%}
|
||||
|
|
Loading…
Reference in a new issue