diff --git a/plugins/action/load_caddy_relay_config.py b/plugins/action/load_caddy_relay_config.py index aa59dfc..a38c008 100644 --- a/plugins/action/load_caddy_relay_config.py +++ b/plugins/action/load_caddy_relay_config.py @@ -195,7 +195,7 @@ class ActionModule(ActionBase): failed, err_msg, loaded_data = self._load_files(filepath) if not failed: main_hostname = Path(filepath).stem - + dns = loaded_data.get("dns", dict()) domain = dns.get("domain", self.default_domain) additionnal_hostname = loaded_data.get('additionnal_hostname', []) state = loaded_data.get("state", "present") @@ -208,6 +208,7 @@ class ActionModule(ActionBase): results['sites'].append('{0}.{1}'.format(main_hostname, domain)) for host in additionnal_hostname: + this_dns = host.get("dns", dns) this_domain = this_dns.get("domain", domain) this_state = host.get('state', state) full_domain = '{0}.{1}'.format(host.get("hostname"), this_domain) if host.get("hostname") else this_domain