-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ticket #678
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk0kTvAACgkQHsardTLnvCV1ewCgpACp3hukxps6/GpmK62OKkxQ
eUcAnR/6tM90xvjPWuy3XOPkoqVs3DcF
=/ko+
-----END PGP SIGNATURE-----
From b9cfe78ea10b7404e0504770e087b882e842d8e0 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <[email protected]>
Date: Tue, 4 Jan 2011 08:55:47 -0500
Subject: [PATCH] A new option to specify reverse zone creation for unattended installs

https://fedorahosted.org/freeipa/ticket/678
---
 install/tools/ipa-dns-install     |    8 +++++++-
 install/tools/ipa-replica-install |   11 ++++++++++-
 install/tools/ipa-server-install  |   10 +++++++++-
 3 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/install/tools/ipa-dns-install b/install/tools/ipa-dns-install
index d4cd1eb..5ae6096 100755
--- a/install/tools/ipa-dns-install
+++ b/install/tools/ipa-dns-install
@@ -40,6 +40,9 @@ def parse_options():
                       help="Add a DNS forwarder")
     parser.add_option("--no-forwarders", dest="no_forwarders", action="store_true",
                       default=False, help="Do not add any DNS forwarders, use root servers instead")
+    parser.add_option("--create-reverse", dest="create_reverse",
+                      action="store_true", default=False,
+                      help="Create reverse DNS zone")
     parser.add_option("--zonemgr", dest="zonemgr", 
                       help="DNS zone manager e-mail address. Defaults to root")
     parser.add_option("-U", "--unattended", dest="unattended", action="store_true",
@@ -164,7 +167,10 @@ def main():
 
     # Create a BIND instance
     bind = bindinstance.BindInstance(fstore, dm_password)
-    create_reverse = bindinstance.create_reverse(options.unattended)
+    if options.unattended:
+        create_reverse = options.create_reverse
+    elif not options.create_reverse:
+        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 9dda13f..e487948 100755
--- a/install/tools/ipa-replica-install
+++ b/install/tools/ipa-replica-install
@@ -66,6 +66,8 @@ def parse_options():
                       help="Add a DNS forwarder")
     parser.add_option("--no-forwarders", dest="no_forwarders", action="store_true",
                       default=False, help="Do not add any DNS forwarders, use root servers instead")
+    parser.add_option("--create-reverse", dest="create_reverse", action="store_true",
+                      default=False, help="Create reverse DNS zone")
     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")
@@ -83,6 +85,8 @@ def parse_options():
             parser.error("You cannot specify a --forwarder option without the --setup-dns option")
         if options.no_forwarders:
             parser.error("You cannot specify a --no-forwarders option without the --setup-dns option")
+        if options.create_reverse:
+            parser.error("You cannot specify a --create-reverse option without the --setup-dns option")
     elif options.forwarders and options.no_forwarders:
         parser.error("You cannot specify a --forwarder option together with --no-forwarders")
     elif not options.forwarders and not options.no_forwarders:
@@ -247,7 +251,12 @@ def install_bind(config, options):
     ip_address = resolve_host(config.host_name)
     if not ip_address:
         sys.exit("Unable to resolve IP address for host name")
-    create_reverse = bindinstance.create_reverse(options.unattended)
+
+    if options.unattended:
+        create_reverse = options.create_reverse
+    elif not options.create_reverse:
+        create_reverse = bindinstance.create_reverse(options.unattended)
+
     bind.setup(config.host_name, ip_address, config.realm_name,
                config.domain_name, forwarders, options.conf_ntp, create_reverse)
     bind.create_instance()
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install
index b73b63e..2fa0c97 100755
--- a/install/tools/ipa-server-install
+++ b/install/tools/ipa-server-install
@@ -99,6 +99,8 @@ def parse_options():
                       help="Add a DNS forwarder")
     parser.add_option("--no-forwarders", dest="no_forwarders", action="store_true",
                       default=False, help="Do not add any DNS forwarders, use root servers instead")
+    parser.add_option("--create-reverse", dest="create_reverse", action="store_true",
+                      default=False, help="Create reverse DNS zone")
     parser.add_option("--zonemgr", dest="zonemgr", 
                       help="DNS zone manager e-mail address. Defaults to root")
     parser.add_option("-U", "--unattended", dest="unattended", action="store_true",
@@ -142,6 +144,8 @@ def parse_options():
             parser.error("You cannot specify a --forwarder option without the --setup-dns option")
         if options.no_forwarders:
             parser.error("You cannot specify a --no-forwarders option without the --setup-dns option")
+        if options.create_reverse:
+            parser.error("You cannot specify a --create-reverse option without the --setup-dns option")
     elif options.forwarders and options.no_forwarders:
         parser.error("You cannot specify a --forwarder option together with --no-forwarders")
 
@@ -836,7 +840,11 @@ def main():
     # Create a BIND instance
     bind = bindinstance.BindInstance(fstore, dm_password)
     if options.setup_dns:
-        create_reverse = bindinstance.create_reverse(options.unattended)
+        if options.unattended:
+            create_reverse = options.create_reverse
+        elif not options.create_reverse:
+            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)
-- 
1.7.3.4

Attachment: jhrozek-freeipa-033-reverse-zone-option.patch.sig
Description: PGP signature

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

Reply via email to