ansible-collection-prometheus/roles/mysqld_exporter/templates/my_cnf.j2
molpako a38e7eed3f fix(mysqld_exporter): Change condition for mysqld_exporter_host check
Modify the condition for `mysqld_exporter_host` in the mysqld_exporter my_cnf.j2 template to address an issue where `mysqld_exporter_host: null` in roles/defaults/main.yml was not being handled correctly. The updated condition ensures the host setting logic operates properly even when `mysqld_exporter_host` is set to null.

Signed-off-by: molpako <system.222.down@gmail.com>
2024-01-03 22:57:15 +09:00

10 lines
304 B
Django/Jinja

{{ ansible_managed | comment }}
[client]
user={{ mysqld_exporter_username }}
password={{ mysqld_exporter_password }}
{% if mysqld_exporter_host %}
host={{ mysqld_exporter_host }}
port={{ mysqld_exporter_port }}
{% elif mysqld_exporter_socket is defined %}
socket={{ mysqld_exporter_socket }}
{% endif %}