From 188a850035aec6ec4457b086ecdc92d6551e089b Mon Sep 17 00:00:00 2001 From: SebClem Date: Fri, 29 Mar 2024 16:20:01 +0100 Subject: [PATCH] Fix full_domain if state != present --- plugins/action/load_haproxy_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/action/load_haproxy_config.py b/plugins/action/load_haproxy_config.py index 78b5d5b..883fbde 100644 --- a/plugins/action/load_haproxy_config.py +++ b/plugins/action/load_haproxy_config.py @@ -249,9 +249,10 @@ class ActionModule(ActionBase): this_protected = host.get('protected', protected) this_state = host.get('state', state) this_uptime_raw_config = host.get("uptime", dict()) + full_domain = '{0}.{1}'.format(host.get("hostname"), this_domain) if host.get("hostname") else this_domain if this_state == "present": - full_domain = '{0}.{1}'.format(host.get("hostname"), this_domain) if host.get("hostname") else this_domain + results['domain_maping'].append('{0} {2}'.format(full_domain, this_domain, backend.get("name"))) if this_protected: results['protected_domain'].append(full_domain)