mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Ask for reverse DNS zone information in attended install right after asking for DNS forwarders, so that DNS configuration is done in one place.
ticket 1522
This commit is contained in:
committed by
Martin Kosek
parent
bc6e128426
commit
8edd7ed998
@@ -107,6 +107,21 @@ def main():
|
||||
if bindinstance.named_conf_exists():
|
||||
sys.exit("\nDNS is already configured in this IPA server.")
|
||||
|
||||
# Create a BIND instance
|
||||
if options.unattended and not options.dm_password:
|
||||
sys.exit("\nIn unattended mode you need to provide at least the -p option")
|
||||
|
||||
dm_password = options.dm_password or read_password("Directory Manager",
|
||||
confirm=False, validate=False)
|
||||
bind = bindinstance.BindInstance(fstore, dm_password)
|
||||
|
||||
# try the connection
|
||||
try:
|
||||
bind.ldap_connect()
|
||||
bind.ldap_disconnect()
|
||||
except ldap.INVALID_CREDENTIALS, e:
|
||||
sys.exit("Password is not valid!")
|
||||
|
||||
# Check we have a public IP that is associated with the hostname
|
||||
if options.ip_address:
|
||||
ip = options.ip_address
|
||||
@@ -137,29 +152,6 @@ def main():
|
||||
dns_forwarders = read_dns_forwarders()
|
||||
logging.debug("will use dns_forwarders: %s\n", str(dns_forwarders))
|
||||
|
||||
conf_ntp = ntpinstance.NTPInstance(fstore).is_enabled()
|
||||
|
||||
if not options.unattended:
|
||||
print ""
|
||||
print "The following operations may take some minutes to complete."
|
||||
print "Please wait until the prompt is returned."
|
||||
print ""
|
||||
|
||||
# Create a BIND instance
|
||||
if options.unattended and not options.dm_password:
|
||||
sys.exit("\nIn unattended mode you need to provide at least the -p option")
|
||||
|
||||
dm_password = options.dm_password or read_password("Directory Manager",
|
||||
confirm=False, validate=False)
|
||||
bind = bindinstance.BindInstance(fstore, dm_password)
|
||||
|
||||
# try the connection
|
||||
try:
|
||||
bind.ldap_connect()
|
||||
bind.ldap_disconnect()
|
||||
except ldap.INVALID_CREDENTIALS, e:
|
||||
sys.exit("Password is not valid!")
|
||||
|
||||
if bind.dm_password:
|
||||
api.Backend.ldap2.connect(bind_dn="cn=Directory Manager", bind_pw=bind.dm_password)
|
||||
else:
|
||||
@@ -179,6 +171,14 @@ def main():
|
||||
if reverse_zone is not None:
|
||||
print "Using reverse zone %s" % reverse_zone
|
||||
|
||||
conf_ntp = ntpinstance.NTPInstance(fstore).is_enabled()
|
||||
|
||||
if not options.unattended:
|
||||
print ""
|
||||
print "The following operations may take some minutes to complete."
|
||||
print "Please wait until the prompt is returned."
|
||||
print ""
|
||||
|
||||
bind.setup(api.env.host, ip_address, api.env.realm, api.env.domain, dns_forwarders, conf_ntp, reverse_zone, zonemgr=options.zonemgr)
|
||||
bind.create_instance()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user