Skip to content

Commit

Permalink
fix(blackbox_exporter): ensure config dir is created and set default.
Browse files Browse the repository at this point in the history
  • Loading branch information
jadyndev committed Aug 25, 2023
1 parent 38cf3a8 commit e236498
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion roles/blackbox_exporter/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,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"
11 changes: 11 additions & 0 deletions roles/blackbox_exporter/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@
createhome: false
when: blackbox_exporter_user != 'root'

- name: Create blackbox_exporter configuration directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: root
group: prometheus
mode: 0770
with_items:
- "{{ blackbox_exporter_config_dir }}"


- name: Get binary
when:
- blackbox_exporter_binary_local_dir | length == 0
Expand Down

0 comments on commit e236498

Please sign in to comment.