52be6859e74a275aa866b736f974eefbfd2e88b2
[mirror/dsa-puppet.git] / modules / ntpdate / templates / etc-default-ntpdate.erb
1 ##
2 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
3 ##
4
5 # The settings in this file are used by the program ntpdate-debian, but not
6 # by the upstream program ntpdate.
7
8 # Set to "yes" to take the server list from /etc/ntp.conf, from package ntp,
9 # so you only have to keep it in one place.
10 NTPDATE_USE_NTP_CONF=no
11
12 # List of NTP servers to use  (Separate multiple servers with spaces.)
13 # Not used if NTPDATE_USE_NTP_CONF is yes.
14 NTPSERVERS=""
15 <%=
16         out = []
17         if fqdn == "ancina.debian.org"
18                 ntpservers = %w{ntp.ugent.be}
19         else
20                 ntpservers = %w{merikanto.debian.org orff.debian.org ravel.debian.org busoni.debian.org}
21         end
22
23         require 'resolv'
24         ntpservers.each do |n|
25                 begin
26                         ip = Resolv.getaddress(n)
27                         out << "NTPSERVERS=\"$NTPSERVERS #{ip}\" # #{n}"
28                 rescue Resolv::ResolvError => e
29                         out << "# Failed to resolve #{n}"
30                 end
31         end
32         out.join("\n")
33 %>
34
35 # Additional options to pass to ntpdate
36 NTPOPTIONS="-u"  # work around broken firewalls