fix: bind_exporter multiple listen addresses definition

Signed-off-by: anviar <oleg.kluchkin+github@gmail.com>
This commit is contained in:
anviar 2024-02-23 22:04:27 +03:00
parent 631971b233
commit 3f9aa6eaba
No known key found for this signature in database
GPG key ID: 1D9496B16B0FC606
2 changed files with 8 additions and 11 deletions

View file

@ -20,17 +20,6 @@
ansible.builtin.package_facts:
when: "not 'packages' in ansible_facts"
- name: Assert that used version supports listen address type
ansible.builtin.assert:
that:
- >-
bind_exporter_web_listen_address is string
or
(
bind_exporter_version is version('0.15.0', '>=') and
bind_exporter_web_listen_address | type_debug == "list"
)
- name: Naive assertion of proper listen address
ansible.builtin.assert:
that:

View file

@ -19,7 +19,15 @@ ExecStart={{ bind_exporter_binary_install_dir }}/bind_exporter \
--bind.timeout="{{ bind_exporter_timeout }}" \
--bind.pid-file="{{ bind_exporter_pid_file }}" \
--bind.stats-version={{ bind_exporter_stats_version }} \
{% if bind_exporter_web_listen_address is iterable and
bind_exporter_web_listen_address is not mapping and
bind_exporter_web_listen_address is not string %}
{% for address in bind_exporter_web_listen_address %}
--web.listen-address={{ address }} \
{% endfor %}
{% else %}
--web.listen-address={{ bind_exporter_web_listen_address }} \
{% endif %}
--web.telemetry-path={{ bind_exporter_web_telemetry_path }}