diff options
author | Martin Nagy <mnagy@redhat.com> | 2009-09-01 23:28:52 +0200 |
---|---|---|
committer | Martin Nagy <mnagy@redhat.com> | 2009-09-08 22:48:34 +0200 |
commit | b519b87ea4f7ddd42001704f1583a1b3370bd0fc (patch) | |
tree | 52916c7ba4b395126a38dea507f1ba27b4850316 | |
parent | 6f37d139cb605ff569877999196550eb49156ed3 (diff) | |
download | freeipa-b519b87ea4f7ddd42001704f1583a1b3370bd0fc.tar.gz freeipa-b519b87ea4f7ddd42001704f1583a1b3370bd0fc.tar.xz freeipa-b519b87ea4f7ddd42001704f1583a1b3370bd0fc.zip |
Add forgotten chunks from commit 4e5a68397a102f0be
I accidentally pushed the older patch that didn't contain bits for
ipa-replica-install.
-rwxr-xr-x | install/tools/ipa-replica-install | 22 | ||||
-rw-r--r-- | install/tools/man/ipa-replica-install.1 | 12 |
2 files changed, 31 insertions, 3 deletions
diff --git a/install/tools/ipa-replica-install b/install/tools/ipa-replica-install index 7f0ec3283..0571f94c6 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(): diff --git a/install/tools/man/ipa-replica-install.1 b/install/tools/man/ipa-replica-install.1 index 168f66582..dd9a9ae99 100644 --- a/install/tools/man/ipa-replica-install.1 +++ b/install/tools/man/ipa-replica-install.1 @@ -37,7 +37,17 @@ Do not configure NTP Directory Manager (existing master) password .TP \fB\-\-setup\-dns\fR -Generate a DNS zone if it does not exist already and configure the DNS server +Generate a DNS zone if it does not exist already and configure the DNS server. +This option requires that you either specify at least one DNS forwarder through +the \fB\-\-forwarder\fR option or use the \fB\-\-no\-forwarders\fR option. +.TP +\fB\-\-forwarder\fR=\fIIP_ADDRESS\fR +Add a DNS forwarder to the DNS configuration. You can use this option multiple +times to specify more forwarders, but at least one must be provided, unless +the \fB\-\-no\-forwarders\fR option is specified. +.TP +\fB\-\-no\-forwarders\fR +Do not add any DNS forwarders. Root DNS servers will be used instead. .SH "EXIT STATUS" 0 if the command was successful |