Skip to content

Commit

Permalink
feat(blackbox_exporter): add web_config option
Browse files Browse the repository at this point in the history
Signed-off-by: Jadyn Emma Jäger <[email protected]>
  • Loading branch information
jadyndev committed Sep 28, 2023
1 parent 3dbc03f commit bf2e2e3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions roles/blackbox_exporter/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ blackbox_exporter_checksums_url: "https://github.com/{{ _blackbox_exporter_repo
blackbox_exporter_skip_install: false

blackbox_exporter_web_listen_address: "0.0.0.0:9115"
blackbox_exporter_web_config:
tls_server_config: {}
http_server_config: {}
basic_auth_users: {}


blackbox_exporter_user: blackbox-exp
blackbox_exporter_group: "{{ blackbox_exporter_user }}"
Expand Down
10 changes: 10 additions & 0 deletions roles/blackbox_exporter/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@
mode: '0644'
notify:
- reload blackbox_exporter

- name: Configure blackbox_exporter web
ansible.builtin.copy:
content: "{{ blackbox_exporter_web_config | to_nice_yaml(indent=2, sort_keys=False) }}"
dest: "{{ blackbox_exporter_config_dir }}/web.yml"
owner: root
group: "{{ blackbox_exporter_group }}"
mode: 0644
notify:
- reload blackbox_exporter
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ PermissionsStartOnly=true
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/local/bin/blackbox_exporter \
--config.file={{ blackbox_exporter_config_dir }}/blackbox_exporter.yml \
--web.config.file={{ blackbox_exporter_config_dir }}/web.yml \
{% for flag, flag_value in blackbox_exporter_cli_flags.items() -%}
--{{ flag }}={{ flag_value }} \
{% endfor -%}
Expand Down

0 comments on commit bf2e2e3

Please sign in to comment.