From a38e7eed3fc9064828e3b47399308665920f5c2c Mon Sep 17 00:00:00 2001 From: molpako Date: Wed, 3 Jan 2024 22:43:41 +0900 Subject: [PATCH] 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 --- roles/mysqld_exporter/templates/my_cnf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/mysqld_exporter/templates/my_cnf.j2 b/roles/mysqld_exporter/templates/my_cnf.j2 index 1188c46e..1813b341 100644 --- a/roles/mysqld_exporter/templates/my_cnf.j2 +++ b/roles/mysqld_exporter/templates/my_cnf.j2 @@ -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 %}