Skip to content

Commit

Permalink
feat(blackbox_exporter) Create config directory
Browse files Browse the repository at this point in the history
Follow the pattern of other exporters and create the configuration file
in `/etc/blackbox_exporter` by default.

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ committed Nov 28, 2023
1 parent 964658f commit 588807e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion roles/blackbox_exporter/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@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"
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@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"
])
Expand Down
8 changes: 8 additions & 0 deletions roles/blackbox_exporter/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 588807e

Please sign in to comment.