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

This commit is contained in:
Rich Megginson
2008-09-16 20:18:11 -06:00
committed by Rob Crittenden
parent 5a5bfa2c70
commit be5e783f72
3 changed files with 12 additions and 13 deletions

View File

@@ -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()

View File

@@ -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

View File

@@ -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: