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-dns-install | 9 ++++++++- install/tools/ipa-replica-install | 14 +++++++++++++- install/tools/ipa-server-install | 14 ++++++++++++-- 3 files changed, 33 insertions(+), 4 deletions(-) (limited to 'install/tools') diff --git a/install/tools/ipa-dns-install b/install/tools/ipa-dns-install index 25aeb610..66cdaffd 100755 --- a/install/tools/ipa-dns-install +++ b/install/tools/ipa-dns-install @@ -42,6 +42,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("--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", @@ -167,7 +170,11 @@ def main(): sys.exit("\nPassword is not valid!") bind.dm_password = read_password("Directory Manager", confirm=False, validate=False) - create_reverse = bindinstance.create_reverse(options.unattended) + create_reverse = True + if options.unattended: + create_reverse = not options.no_reverse + elif not options.no_reverse: + create_reverse = bindinstance.create_reverse() bind.setup(api.env.host, ip_address, api.env.realm, api.env.domain, dns_forwarders, conf_ntp, create_reverse, zonemgr=options.zonemgr) if bind.dm_password: diff --git a/install/tools/ipa-replica-install b/install/tools/ipa-replica-install index ee84e32d..0e6eecae 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("--no-reverse", dest="no_reverse", action="store_true", + default=False, help="Do not 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") @@ -85,6 +87,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") elif not options.forwarders and not options.no_forwarders: @@ -249,7 +253,15 @@ 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) + + create_reverse = True + 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(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 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