Fix dns
This commit is contained in:
parent
547a265a07
commit
a7966f0a41
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user