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

https://fedorahosted.org/freeipa/ticket/418

-- 
Jakub Hrozek
Red Hat
>From 2e54c194bd40d59e7bf2625dd2beb6cb42cbd4bd Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <[email protected]>
Date: Thu, 11 Nov 2010 19:27:27 +0100
Subject: [PATCH] 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
---
 install/tools/ipa-dns-install     |    3 ++-
 install/tools/ipa-replica-install |    3 ++-
 install/tools/ipa-server-install  |    3 ++-
 ipaserver/install/bindinstance.py |   12 ++++++++++--
 4 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/install/tools/ipa-dns-install b/install/tools/ipa-dns-install
index 5604931..bf6679e 100755
--- a/install/tools/ipa-dns-install
+++ b/install/tools/ipa-dns-install
@@ -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()
 
diff --git a/install/tools/ipa-replica-install 
b/install/tools/ipa-replica-install
index e4aae4a..2fee483 100755
--- a/install/tools/ipa-replica-install
+++ b/install/tools/ipa-replica-install
@@ -223,8 +223,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():
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install
index f0c7a17..a709e18 100755
--- a/install/tools/ipa-server-install
+++ b/install/tools/ipa-server-install
@@ -763,7 +763,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)
 
diff --git a/ipaserver/install/bindinstance.py 
b/ipaserver/install/bindinstance.py
index 4e63e7e..ec74564 100644
--- a/ipaserver/install/bindinstance.py
+++ b/ipaserver/install/bindinstance.py
@@ -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,7 +254,8 @@ 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)
-        self.step("setting up reverse zone", self.__setup_reverse_zone)
+        if self.create_reverse:
+            self.step("setting up reverse zone", self.__setup_reverse_zone)
 
         self.step("setting up kerberos principal", self.__setup_principal)
         self.step("setting up named.conf", self.__setup_named_conf)
-- 
1.7.3.2

_______________________________________________
Freeipa-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to