This commit is contained in:
SebClem 2024-09-17 15:43:39 +02:00
parent 547a265a07
commit a7966f0a41
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50

View File

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