From 5cfd84756b04ed603bb72643857faa9988b441fc Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Tue, 16 Sep 2008 20:18:11 -0600 Subject: add --no-host-dns option to ipa-server-install - allows specifying a hostname that might actually exist but you do not want to even attempt to resolve it via DNS --- ipa-server/ipa-install/ipa-server-install | 11 +++++++---- ipa-server/ipa-install/share/indices.ldif | 8 -------- ipa-server/ipaserver/installutils.py | 6 +++++- 3 files changed, 12 insertions(+), 13 deletions(-) (limited to 'ipa-server') diff --git a/ipa-server/ipa-install/ipa-server-install b/ipa-server/ipa-install/ipa-server-install index 2ac2638cf..c9d5c5bf3 100644 --- a/ipa-server/ipa-install/ipa-server-install +++ b/ipa-server/ipa-install/ipa-server-install @@ -86,6 +86,9 @@ def parse_options(): help="The password of the Directory Server PKCS#12 file") parser.add_option("--http_pin", dest="http_pin", help="The password of the Apache Server PKCS#12 file") + parser.add_option("--no-host-dns", dest="no_host_dns", action="store_true", + default=False, + help="Do not use DNS for hostname lookup during installation") options, args = parser.parse_args() @@ -119,7 +122,7 @@ def signal_handler(signum, frame): ipaserver.dsinstance.erase_ds_instance_data (ds.serverid) sys.exit(1) -def read_host_name(host_default): +def read_host_name(host_default,no_host_dns=False): host_name = "" print "Enter the fully qualified domain name of the computer" @@ -134,7 +137,7 @@ def read_host_name(host_default): host_name = user_input("Server host name", host_default, allow_empty = False) print "" try: - verify_fqdn(host_name) + verify_fqdn(host_name,no_host_dns) except Exception, e: raise e else: @@ -394,14 +397,14 @@ def main(): if options.unattended: try: - verify_fqdn(host_default) + verify_fqdn(host_default,options.no_host_dns) except RuntimeError, e: logging.error(str(e) + "\n") return 1 host_name = host_default else: - host_name = read_host_name(host_default) + host_name = read_host_name(host_default,options.no_host_dns) host_name = host_name.lower() diff --git a/ipa-server/ipa-install/share/indices.ldif b/ipa-server/ipa-install/share/indices.ldif index 3fb2f33d6..632a28791 100644 --- a/ipa-server/ipa-install/share/indices.ldif +++ b/ipa-server/ipa-install/share/indices.ldif @@ -64,14 +64,6 @@ changetype: modify add: nsIndexType nsIndexType:sub -dn: cn=memberof,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config -changetype: add -objectClass:top -objectClass:nsIndex -cn:memberof -nsSystemIndex:false -nsIndexType:eq - dn: cn=uidnumber,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config changetype: add objectClass:top diff --git a/ipa-server/ipaserver/installutils.py b/ipa-server/ipaserver/installutils.py index 90e1c6ab6..563b168e8 100644 --- a/ipa-server/ipaserver/installutils.py +++ b/ipa-server/ipaserver/installutils.py @@ -43,7 +43,7 @@ def get_fqdn(): fqdn = "" return fqdn -def verify_fqdn(host_name): +def verify_fqdn(host_name,no_host_dns=False): if len(host_name.split(".")) < 2 or host_name == "localhost.localdomain": raise RuntimeError("Invalid hostname: " + host_name) @@ -66,6 +66,10 @@ def verify_fqdn(host_name): if revname != host_name: raise RuntimeError("The host name %s does not match the reverse lookup %s" % (host_name, revname)) + if no_host_dns: + print "Warning: skipping DNS resolution of host", host_name + return + # Verify this is NOT a CNAME rs = dnsclient.query(host_name+".", dnsclient.DNS_C_IN, dnsclient.DNS_T_CNAME) if len(rs) != 0: -- cgit