summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-server-install
diff options
context:
space:
mode:
Diffstat (limited to 'install/tools/ipa-server-install')
-rwxr-xr-xinstall/tools/ipa-server-install36
1 files changed, 21 insertions, 15 deletions
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install
index 504da2c61..35b16dae8 100755
--- a/install/tools/ipa-server-install
+++ b/install/tools/ipa-server-install
@@ -100,7 +100,7 @@ def parse_options():
help="File containing PKCS#10 of the external CA chain")
parser.add_option("--hostname", dest="host_name", help="fully qualified name of server")
parser.add_option("--ip-address", dest="ip_address",
- type="ip", ip_netmask=True, ip_local=True,
+ type="ip", ip_local=True,
help="Master Server IP Address")
parser.add_option("--setup-dns", dest="setup_dns", action="store_true",
default=False, help="configure bind with our zone")
@@ -108,6 +108,7 @@ def parse_options():
type="ip", 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("--reverse-zone", dest="reverse_zone", help="The reverse DNS zone to use")
parser.add_option("--no-reverse", dest="no_reverse", action="store_true",
default=False, help="Do not create reverse DNS zone")
parser.add_option("--zonemgr", action="callback", callback=zonemgr_callback,
@@ -154,10 +155,14 @@ 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.reverse_zone:
+ parser.error("You cannot specify a --reverse-zone 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 options.reverse_zone and options.no_reverse:
+ parser.error("You cannot specify a --reverse-zone option together with --no-reverse")
if options.uninstall:
if (options.realm_name or
@@ -552,7 +557,7 @@ def main():
master_password = ""
dm_password = ""
admin_password = ""
- create_reverse = True
+ reverse_zone = None
# check bind packages are installed
if options.setup_dns:
@@ -631,7 +636,9 @@ def main():
ip = read_ip_address(host_name, fstore)
logging.debug("read ip_address: %s\n" % str(ip))
ip_address = str(ip)
- ip_prefixlen = ip.prefixlen
+
+ if options.reverse_zone and not bindinstance.verify_reverse_zone(options.reverse_zone, ip):
+ sys.exit(1)
print "The IPA Master Server will be configured with"
print "Hostname: " + host_name
@@ -896,18 +903,17 @@ def main():
# Create a BIND instance
bind = bindinstance.BindInstance(fstore, dm_password)
if options.setup_dns:
- if options.unattended:
- # In unattended mode just use the cmdline flag
- create_reverse = not options.no_reverse
- else:
- if options.no_reverse:
- create_reverse = False
- else:
- # In interactive mode, if the flag was not explicitly
- # specified, ask the user
- create_reverse = bindinstance.create_reverse()
-
- bind.setup(host_name, ip_address, ip_prefixlen, realm_name, domain_name, dns_forwarders, options.conf_ntp, create_reverse, zonemgr=options.zonemgr)
+ if options.reverse_zone:
+ reverse_zone = bindinstance.normalize_zone(options.reverse_zone)
+ elif not options.no_reverse:
+ reverse_zone = bindinstance.get_reverse_zone_default(ip)
+ if not options.unattended and bindinstance.create_reverse():
+ reverse_zone = bindinstance.read_reverse_zone(reverse_zone, ip)
+
+ if reverse_zone is not None:
+ print "Using reverse zone %s" % reverse_zone
+
+ bind.setup(host_name, ip_address, realm_name, domain_name, dns_forwarders, options.conf_ntp, reverse_zone, zonemgr=options.zonemgr)
if options.setup_dns:
api.Backend.ldap2.connect(bind_dn="cn=Directory Manager", bind_pw=dm_password)