From 9232a478773ea06f31938d3d202a15d91c58034e Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Tue, 4 Jan 2011 08:55:47 -0500 Subject: Create the reverse zone by default A new option to specify reverse zone creation for unattended installs https://fedorahosted.org/freeipa/ticket/678 --- install/tools/ipa-server-install | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'install/tools/ipa-server-install') diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install index 19f80a79..173f5c25 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("--no-reverse", dest="no_reverse", action="store_true", + default=False, help="Do not 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.no_reverse: + parser.error("You cannot specify a --no-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") @@ -545,7 +549,7 @@ def main(): master_password = "" dm_password = "" admin_password = "" - create_reverse = False + create_reverse = True # check bind packages are installed if options.setup_dns: @@ -837,7 +841,13 @@ 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: + # In unattended mode just use the cmdline flag + create_reverse = not options.no_reverse + elif not options.no_reverse: + # In interactive mode, if the flag was not explicitly specified, ask the user + create_reverse = bindinstance.create_reverse() + 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) -- cgit