From 753e744d17ea71e068b786fc81b126bf18060156 Mon Sep 17 00:00:00 2001 From: SebClem Date: Tue, 13 Jun 2023 17:39:51 +0200 Subject: [PATCH] Fix if additional host is "" --- plugins/action/load_haproxy_config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/action/load_haproxy_config.py b/plugins/action/load_haproxy_config.py index 80a91aa..6aba3f6 100644 --- a/plugins/action/load_haproxy_config.py +++ b/plugins/action/load_haproxy_config.py @@ -232,9 +232,10 @@ class ActionModule(ActionBase): this_state = host.get('state', state) if this_state == "present": - results['domain_maping'].append('{0}.{1} {2}'.format(host.get("hostname"), this_domain, backend.get("name"))) + 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('{0}.{1}'.format(host.get("hostname"), this_domain)) + results['protected_domain'].append(full_domain) if not this_dns.get("skip", dns.get("skip", False)): if not this_dns_provider in results['dns_hostnames']: