diff options
author | Martin Basti <mbasti@redhat.com> | 2016-06-16 21:16:39 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-06-17 18:05:03 +0200 |
commit | 313e63e3e4ba1aa3dd2ae5de54f6d277329fffee (patch) | |
tree | b19aa85c420fa1e285e219a78998b3caee2c9e58 /ipaserver/dns_data_management.py | |
parent | 4155eb7b13b20605886ba79c02c232f83a7b439c (diff) | |
download | freeipa-313e63e3e4ba1aa3dd2ae5de54f6d277329fffee.tar.gz freeipa-313e63e3e4ba1aa3dd2ae5de54f6d277329fffee.tar.xz freeipa-313e63e3e4ba1aa3dd2ae5de54f6d277329fffee.zip |
DNS Locations: generate NTP records
Move NTP records to centralized record generator
https://fedorahosted.org/freeipa/ticket/2008
Reviewed-By: Petr Spacek <pspacek@redhat.com>
Diffstat (limited to 'ipaserver/dns_data_management.py')
-rw-r--r-- | ipaserver/dns_data_management.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/ipaserver/dns_data_management.py b/ipaserver/dns_data_management.py index 4074b0318..3ca40c785 100644 --- a/ipaserver/dns_data_management.py +++ b/ipaserver/dns_data_management.py @@ -44,6 +44,11 @@ IPA_DEFAULT_ADTRUST_SRV_REC = ( (DNSName(u'_kerberos._udp.dc._msdcs'), 88), ) +IPA_DEFAULT_NTP_SRV_REC = ( + # srv record name, port + (DNSName("_ntp._udp"), 123), +) + class IPADomainIsNotManagedByIPAError(Exception): pass @@ -180,6 +185,14 @@ class IPASystemRecords(object): weight=server['weight'] ) + if 'NTP server' in eff_roles: + self.__add_srv_records( + zone_obj, + hostname_abs, + IPA_DEFAULT_NTP_SRV_REC, + weight=server['weight'] + ) + def _get_location_dns_records_for_server( self, zone_obj, hostname, locations, roles=None, include_master_role=True): @@ -217,6 +230,16 @@ class IPASystemRecords(object): location=location ) + if 'NTP server' in eff_roles: + self.__add_srv_records( + zone_obj, + hostname_abs, + IPA_DEFAULT_NTP_SRV_REC, + weight=server['weight'], + priority=priority, + location=location + ) + return zone_obj def __prepare_records_update_dict(self, node): @@ -332,7 +355,8 @@ class IPASystemRecords(object): names_requiring_cname_templates = set( rec[0].derelativize(self.domain_abs) for rec in ( IPA_DEFAULT_MASTER_SRV_REC + - IPA_DEFAULT_ADTRUST_SRV_REC + IPA_DEFAULT_ADTRUST_SRV_REC + + IPA_DEFAULT_NTP_SRV_REC ) ) @@ -405,6 +429,7 @@ class IPASystemRecords(object): for records in ( IPA_DEFAULT_MASTER_SRV_REC, IPA_DEFAULT_ADTRUST_SRV_REC, + IPA_DEFAULT_NTP_SRV_REC ): for name, _port in records: loc_records.append( |