mirror of
https://github.com/prometheus-community/ansible
synced 2025-02-16 12:48:26 +00:00
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:
parent
964658f7ea
commit
588807e4d8
4 changed files with 11 additions and 3 deletions
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
])
|
||||
|
|
|
@ -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"
|
||||
])
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue