Joey Boggs
2009-Jan-28 15:48 UTC
[Ovirt-devel] [PATCH server] dns forward/reverse lookup update / dnsdomainname is default for dhcp domain
--- installer/bin/ovirt-installer | 20 ++++++++++++++------ 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer index 6fab09a..99601d4 100755 --- a/installer/bin/ovirt-installer +++ b/installer/bin/ovirt-installer @@ -149,22 +149,30 @@ prov_ip = `ifconfig #{prov_dev}` prov_ipaddr= prov_ip.scan(/\s*inet addr:([\d.]+)/) if dns_servers == "y" - host_lookup = Socket.getaddrinfo(ipa_host,nil) - hostip = host_lookup[1][3] - if hostip.to_s != mgmt_ipaddr.to_s - @cli.say("Reverse dns lookup for #{ipa_host} failed, exiting") - exit + mgmt_ipaddr_lookup = Socket.getaddrinfo(mgmt_ipaddr.to_s,nil) + mgmt_hostname = mgmt_ipaddr_lookup[1][2] + if mgmt_hostname.to_s != ipa_host.to_s + @cli.say("Reverse dns lookup for #{mgmt_ipaddr} failed, exiting") + exit(0) + end + + ipa_host_lookup = Socket.getaddrinfo(ipa_host,nil) + ipa_hostip = ipa_host_lookup[1][3] + if ipa_hostip.to_s != mgmt_ipaddr.to_s + @cli.say("Forward dns lookup for #{ipa_host} failed, exiting") + exit(0) end end # DHCP Configuration dhcp_setup = prompt_yes_no("Does your provisioning network already have dhcp?") if dhcp_setup == "n" + dnsdomainname = `/bin/dnsdomainname` dhcp_interface = prov_dev dhcp_network = prompt_for_answer("Enter the first 3 octets of the dhcp network you wish to use (example: 192.168.50):", :regex => THREE_OCTETS) dhcp_start = prompt_for_answer("Enter the dhcp pool start address (example: 3):", :regex => OCTET) dhcp_stop = prompt_for_answer("Enter the dhcp pool end addess (example: 100):", :regex => OCTET) - dhcp_domain = prompt_for_answer("Enter the dhcp domain you wish to use (example: example.com):", :regex => IP_OR_FQDN) + dhcp_domain = prompt_for_answer("Enter the dhcp domain you wish to use (example: example.com):", :default => dnsdomainname.chomp, :regex => IP_OR_FQDN) tftp_setup = prompt_yes_no("Provide pxe/tftp capability?") if sep_networks == "y" -- 1.6.0.6