Skip to content

Commit

Permalink
# Note: Domain Name is currently set through DHCP, if enabled then do…
Browse files Browse the repository at this point in the history
…main_name is empty and hpilo_ca can't update. Avoiding loop.
  • Loading branch information
Flavio Torres committed May 2, 2018
1 parent 16bdd9c commit 6b27935
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions examples/ca/hpilo_ca
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,19 @@ def sign_certificates(hosts, openssl, login, password, opts):
cn = ilo.get_cert_subject_info()['csr_subject_common_name']

hn, dn = hostname.split('.', 1)
if network_settings['dns_name'] != hn or dn and network_settings['domain_name'] != dn:
print("Hostname misconfigured on the ilo, fixing")
ilo.mod_network_settings(dns_name=hn, domain_name=dn)
todo.append(hostname)
continue
if network_settings["dhcp_domain_name"]:
# Note: Domain Name is currently set through DHCP, if enabled then domain_name is empty and hpilo_ca can't update. Avoiding loop.
if network_settings['dns_name'] != hn:
print("Hostname misconfigured on the ilo - hn:[%s] dn:[%s], fixing") % (network_settings['dns_name'], hn)
ilo.mod_network_settings(dns_name=hn, domain_name=dn)
todo.append(hostname)
continue
else:
if network_settings['dns_name'] != hn or dn and network_settings['domain_name'] != dn:
print("Hostname misconfigured on the ilo - hn:[%s] dn:[%s] vs hn:[%s] dn:[%s], fixing") % (network_settings['dns_name'], network_settings['domain_name'], hn, dn)
ilo.mod_network_settings(dns_name=hn, domain_name=dn)
todo.append(hostname)
continue

print("(2/5) Retrieving certificate signing request")
if fw_version['management_processor'].lower() == 'ilo2':
Expand Down

0 comments on commit 6b27935

Please sign in to comment.