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>
This commit is contained in:
molpako 2024-01-03 22:43:41 +09:00
parent 172b4bbb08
commit a38e7eed3f

View file

@ -2,7 +2,7 @@
[client]
user={{ mysqld_exporter_username }}
password={{ mysqld_exporter_password }}
{% if mysqld_exporter_host is defined %}
{% if mysqld_exporter_host %}
host={{ mysqld_exporter_host }}
port={{ mysqld_exporter_port }}
{% elif mysqld_exporter_socket is defined %}