Do not create reverse zone by default

Prompt for creation of reverse zone, with the default for unattended
installations being False.

https://fedorahosted.org/freeipa/ticket/418
This commit is contained in:
Jakub Hrozek 2010-11-11 19:27:27 +01:00 committed by Simo Sorce
parent a41e69fba3
commit 88188cbb20
4 changed files with 16 additions and 5 deletions

View File

@ -161,7 +161,8 @@ def main():
# Create a BIND instance
bind = bindinstance.BindInstance(fstore, dm_password)
bind.setup(api.env.host, ip_address, api.env.realm, api.env.domain, dns_forwarders, conf_ntp, zonemgr=options.zonemgr)
create_reverse = bindinstance.create_reverse(options.unattended)
bind.setup(api.env.host, ip_address, api.env.realm, api.env.domain, dns_forwarders, conf_ntp, create_reverse, zonemgr=options.zonemgr)
api.Backend.ldap2.connect(bind_dn="cn=Directory Manager", bind_pw=dm_password)
bind.create_instance()

View File

@ -239,8 +239,9 @@ def install_bind(config, options):
forwarders = ()
bind = bindinstance.BindInstance(dm_password=config.dirman_password)
ip_address = resolve_host(config.host_name)
create_reverse = bindinstance.create_reverse(options.unattended)
bind.setup(config.host_name, ip_address, config.realm_name,
config.domain_name, forwarders, options.conf_ntp)
config.domain_name, forwarders, options.conf_ntp, create_reverse)
bind.create_instance()
def check_dirsrv():

View File

@ -822,7 +822,8 @@ def main():
# Create a BIND instance
bind = bindinstance.BindInstance(fstore, dm_password)
bind.setup(host_name, ip_address, realm_name, domain_name, dns_forwarders, options.conf_ntp, zonemgr=options.zonemgr)
create_reverse = bindinstance.create_reverse(options.unattended)
bind.setup(host_name, ip_address, realm_name, domain_name, dns_forwarders, options.conf_ntp, create_reverse, zonemgr=options.zonemgr)
if options.setup_dns:
api.Backend.ldap2.connect(bind_dn="cn=Directory Manager", bind_pw=dm_password)

View File

@ -58,6 +58,11 @@ def check_inst(unattended):
return True
def create_reverse(unattended):
if unattended:
return False
return ipautil.user_input("Do you want to configure the reverse zone?", False)
def dns_container_exists(fqdn, realm):
"""
Test whether the dns container exists.
@ -200,13 +205,14 @@ class BindInstance(service.Service):
self.realm = None
self.forwarders = None
self.sub_dict = None
self.create_reverse = False
if fstore:
self.fstore = fstore
else:
self.fstore = sysrestore.FileStore('/var/lib/ipa/sysrestore')
def setup(self, fqdn, ip_address, realm_name, domain_name, forwarders, ntp, named_user="named", zonemgr=None):
def setup(self, fqdn, ip_address, realm_name, domain_name, forwarders, ntp, create_reverse, named_user="named", zonemgr=None):
self.named_user = named_user
self.fqdn = fqdn
self.ip_address = ip_address
@ -216,6 +222,7 @@ class BindInstance(service.Service):
self.host = fqdn.split(".")[0]
self.suffix = util.realm_to_suffix(self.realm)
self.ntp = ntp
self.create_reverse = create_reverse
if zonemgr:
self.zonemgr = zonemgr.replace('@','.')
@ -247,6 +254,7 @@ class BindInstance(service.Service):
if not dns_container_exists(self.fqdn, self.suffix):
self.step("adding DNS container", self.__setup_dns_container)
self.step("setting up our zone", self.__setup_zone)
if self.create_reverse:
self.step("setting up reverse zone", self.__setup_reverse_zone)
self.step("setting up kerberos principal", self.__setup_principal)