feat(blackbox_exporter) Create config directory

Follow the pattern of other exporters and create the configuration file
in `/etc/blackbox_exporter` by default.

Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
SuperQ 2023-11-28 17:58:36 +01:00
parent 964658f7ea
commit 588807e4d8
No known key found for this signature in database
GPG key ID: C646B23C9E3245F1
4 changed files with 11 additions and 3 deletions

View file

@ -72,6 +72,6 @@ blackbox_exporter_configuration_modules:
# fail_if_matches_regexp: [test]
# Where to put the blackbox_exporter.yml main configuration file
blackbox_exporter_config_dir: /etc
blackbox_exporter_config_dir: /etc/blackbox_exporter
blackbox_exporter_binary_install_dir: "/usr/local/bin"

View file

@ -10,7 +10,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
@pytest.mark.parametrize("files", [
"/etc/blackbox_exporter.yml",
"/etc/blackbox_exporter/blackbox_exporter.yml",
"/etc/systemd/system/blackbox_exporter.service",
"/usr/local/bin/blackbox_exporter"
])

View file

@ -10,7 +10,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
@pytest.mark.parametrize("files", [
"/etc/blackbox_exporter.yml",
"/etc/blackbox_exporter/blackbox_exporter.yml",
"/etc/systemd/system/blackbox_exporter.service",
"/usr/local/bin/blackbox_exporter"
])

View file

@ -9,6 +9,14 @@
notify:
- restart blackbox_exporter
- name: Create blackbox_exporter config directory
ansible.builtin.file:
path: "{{ blackbox_exporter_config_dir }}"
state: directory
owner: root
group: root
mode: u+rwX,g+rwX,o=rX
- name: Configure blackbox exporter
ansible.builtin.template:
src: blackbox_exporter.yml.j2