diff options
Diffstat (limited to 'install/tools/ipa-replica-install')
-rwxr-xr-x | install/tools/ipa-replica-install | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/install/tools/ipa-replica-install b/install/tools/ipa-replica-install index 7f0ec328..0571f94c 100755 --- a/install/tools/ipa-replica-install +++ b/install/tools/ipa-replica-install @@ -60,12 +60,26 @@ def parse_options(): help="Directory Manager (existing master) password") parser.add_option("--setup-dns", dest="setup_dns", action="store_true", default=False, help="configure bind with our zone") + parser.add_option("--forwarder", dest="forwarders", action="append", + 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") options, args = parser.parse_args() if len(args) != 1: parser.error("you must provide a file generated by ipa-replica-prepare") + if not options.setup_dns: + if options.forwarders: + 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") + 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: + parser.error("You must specify at least one --forwarder option or --no-forwarders option") + return options, args[0] def get_dirman_password(): @@ -189,10 +203,14 @@ def install_http(config): print "error copying files: " + str(e) sys.exit(1) -def install_bind(config): +def install_bind(config, options): + if options.forwarders: + forwarders = options.forwarders + else: + forwarders = () bind = bindinstance.BindInstance(dm_password=config.dirman_password) ip_address = resolve_host(config.host_name) - bind.setup(config.host_name, ip_address, config.realm_name, config.domain_name) + bind.setup(config.host_name, ip_address, config.realm_name, config.domain_name, forwarders) bind.create_instance() def check_dirsrv(): |