mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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
This commit is contained in:
committed by
Rob Crittenden
parent
686203c074
commit
7aa78ee060
@@ -23,6 +23,4 @@ _kerberos-master._tcp IN SRV 0 100 88 $HOST
|
|||||||
_kerberos-master._udp IN SRV 0 100 88 $HOST
|
_kerberos-master._udp IN SRV 0 100 88 $HOST
|
||||||
_kpasswd._tcp IN SRV 0 100 464 $HOST
|
_kpasswd._tcp IN SRV 0 100 464 $HOST
|
||||||
_kpasswd._udp IN SRV 0 100 464 $HOST
|
_kpasswd._udp IN SRV 0 100 464 $HOST
|
||||||
|
$OPTIONAL_NTP
|
||||||
;ntp server
|
|
||||||
_ntp._udp IN SRV 0 100 123 $HOST
|
|
||||||
|
@@ -219,7 +219,8 @@ def install_bind(config, options):
|
|||||||
forwarders = ()
|
forwarders = ()
|
||||||
bind = bindinstance.BindInstance(dm_password=config.dirman_password)
|
bind = bindinstance.BindInstance(dm_password=config.dirman_password)
|
||||||
ip_address = resolve_host(config.host_name)
|
ip_address = resolve_host(config.host_name)
|
||||||
bind.setup(config.host_name, ip_address, config.realm_name, config.domain_name, forwarders)
|
bind.setup(config.host_name, ip_address, config.realm_name,
|
||||||
|
config.domain_name, forwarders, options.conf_ntp)
|
||||||
bind.create_instance()
|
bind.create_instance()
|
||||||
|
|
||||||
def check_dirsrv():
|
def check_dirsrv():
|
||||||
|
@@ -808,7 +808,7 @@ def main():
|
|||||||
|
|
||||||
# Create a BIND instance
|
# Create a BIND instance
|
||||||
bind = bindinstance.BindInstance(fstore, dm_password)
|
bind = bindinstance.BindInstance(fstore, dm_password)
|
||||||
bind.setup(host_name, ip_address, realm_name, domain_name, dns_forwarders)
|
bind.setup(host_name, ip_address, realm_name, domain_name, dns_forwarders, options.conf_ntp)
|
||||||
if options.setup_dns:
|
if options.setup_dns:
|
||||||
api.Backend.ldap2.connect(bind_dn="cn=Directory Manager", bind_pw=dm_password)
|
api.Backend.ldap2.connect(bind_dn="cn=Directory Manager", bind_pw=dm_password)
|
||||||
|
|
||||||
|
@@ -121,7 +121,7 @@ class BindInstance(service.Service):
|
|||||||
else:
|
else:
|
||||||
self.fstore = sysrestore.FileStore('/var/lib/ipa/sysrestore')
|
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.named_user = named_user
|
||||||
self.fqdn = fqdn
|
self.fqdn = fqdn
|
||||||
self.ip_address = ip_address
|
self.ip_address = ip_address
|
||||||
@@ -130,6 +130,7 @@ class BindInstance(service.Service):
|
|||||||
self.forwarders = forwarders
|
self.forwarders = forwarders
|
||||||
self.host = fqdn.split(".")[0]
|
self.host = fqdn.split(".")[0]
|
||||||
self.suffix = util.realm_to_suffix(self.realm)
|
self.suffix = util.realm_to_suffix(self.realm)
|
||||||
|
self.ntp = ntp
|
||||||
|
|
||||||
tmp = ip_address.split(".")
|
tmp = ip_address.split(".")
|
||||||
tmp.reverse()
|
tmp.reverse()
|
||||||
@@ -210,13 +211,20 @@ class BindInstance(service.Service):
|
|||||||
else:
|
else:
|
||||||
fwds = " "
|
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,
|
self.sub_dict = dict(FQDN=self.fqdn,
|
||||||
IP=self.ip_address,
|
IP=self.ip_address,
|
||||||
DOMAIN=self.domain,
|
DOMAIN=self.domain,
|
||||||
HOST=self.host,
|
HOST=self.host,
|
||||||
REALM=self.realm,
|
REALM=self.realm,
|
||||||
FORWARDERS=fwds,
|
FORWARDERS=fwds,
|
||||||
SUFFIX=self.suffix)
|
SUFFIX=self.suffix,
|
||||||
|
OPTIONAL_NTP=optional_ntp)
|
||||||
|
|
||||||
def __setup_dns_container(self):
|
def __setup_dns_container(self):
|
||||||
self._ldap_mod("dns.ldif", self.sub_dict)
|
self._ldap_mod("dns.ldif", self.sub_dict)
|
||||||
@@ -237,7 +245,8 @@ class BindInstance(service.Service):
|
|||||||
zone = add_zone(self.domain)
|
zone = add_zone(self.domain)
|
||||||
for (host, type, rdata) in resource_records:
|
for (host, type, rdata) in resource_records:
|
||||||
add_rr(zone, host, type, rdata)
|
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):
|
def __setup_reverse_zone(self):
|
||||||
add_reverze_zone(self.ip_address)
|
add_reverze_zone(self.ip_address)
|
||||||
|
Reference in New Issue
Block a user