summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/bindinstance.py
diff options
context:
space:
mode:
authorMartin Nagy <mnagy@redhat.com>2009-11-10 15:16:38 +0100
committerRob Crittenden <rcritten@redhat.com>2010-01-21 17:09:21 -0500
commit7aa78ee06018286efd3f6517a12249e2267536eb (patch)
tree3747974065c61e7f366af444a835b79a45067d6f /ipaserver/install/bindinstance.py
parent686203c0743736028283a8a18c46a19e6f8dd57c (diff)
downloadfreeipa-7aa78ee06018286efd3f6517a12249e2267536eb.tar.gz
freeipa-7aa78ee06018286efd3f6517a12249e2267536eb.tar.xz
freeipa-7aa78ee06018286efd3f6517a12249e2267536eb.zip
Only add an NTP SRV record if we really are setting up NTP
The sample bind zone file that is generated if we don't use --setup-dns is also changed. Fixes #500238
Diffstat (limited to 'ipaserver/install/bindinstance.py')
-rw-r--r--ipaserver/install/bindinstance.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py
index 40b0df7e0..8ee46d462 100644
--- a/ipaserver/install/bindinstance.py
+++ b/ipaserver/install/bindinstance.py
@@ -121,7 +121,7 @@ class BindInstance(service.Service):
else:
self.fstore = sysrestore.FileStore('/var/lib/ipa/sysrestore')
- def setup(self, fqdn, ip_address, realm_name, domain_name, forwarders, named_user="named"):
+ def setup(self, fqdn, ip_address, realm_name, domain_name, forwarders, ntp, named_user="named"):
self.named_user = named_user
self.fqdn = fqdn
self.ip_address = ip_address
@@ -130,6 +130,7 @@ class BindInstance(service.Service):
self.forwarders = forwarders
self.host = fqdn.split(".")[0]
self.suffix = util.realm_to_suffix(self.realm)
+ self.ntp = ntp
tmp = ip_address.split(".")
tmp.reverse()
@@ -210,13 +211,20 @@ class BindInstance(service.Service):
else:
fwds = " "
+ if self.ntp:
+ optional_ntp = "\n;ntp server\n"
+ optional_ntp += "_ntp._udp\t\tIN SRV 0 100 123\t%s""" % self.host
+ else:
+ optional_ntp = ""
+
self.sub_dict = dict(FQDN=self.fqdn,
IP=self.ip_address,
DOMAIN=self.domain,
HOST=self.host,
REALM=self.realm,
FORWARDERS=fwds,
- SUFFIX=self.suffix)
+ SUFFIX=self.suffix,
+ OPTIONAL_NTP=optional_ntp)
def __setup_dns_container(self):
self._ldap_mod("dns.ldif", self.sub_dict)
@@ -237,7 +245,8 @@ class BindInstance(service.Service):
zone = add_zone(self.domain)
for (host, type, rdata) in resource_records:
add_rr(zone, host, type, rdata)
- add_rr(zone, "_ntp._udp", "SRV", "0 100 123 "+self.host)
+ if self.ntp:
+ add_rr(zone, "_ntp._udp", "SRV", "0 100 123 "+self.host)
def __setup_reverse_zone(self):
add_reverze_zone(self.ip_address)