X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fntpdate%2Ftemplates%2Fetc-default-ntpdate.erb;h=52be6859e74a275aa866b736f974eefbfd2e88b2;hb=7a6e0fd9840f072852557a25b1560ab4c17111d6;hp=4607f647e7f295867e9ce41ebd9986b8d7e7f51b;hpb=7316d18dab2a19bd3721b9ac1eed1abb91af758e;p=mirror%2Fdsa-puppet.git diff --git a/modules/ntpdate/templates/etc-default-ntpdate.erb b/modules/ntpdate/templates/etc-default-ntpdate.erb index 4607f647e..52be6859e 100644 --- a/modules/ntpdate/templates/etc-default-ntpdate.erb +++ b/modules/ntpdate/templates/etc-default-ntpdate.erb @@ -11,11 +11,26 @@ NTPDATE_USE_NTP_CONF=no # List of NTP servers to use (Separate multiple servers with spaces.) # Not used if NTPDATE_USE_NTP_CONF is yes. -# merikanto 86.59.118.147 -# orff 194.177.211.209 -# ravel 206.12.19.5 -# busoni 140.211.15.34 -NTPSERVERS="86.59.118.147 194.177.211.209 206.12.19.5 140.211.15.34" +NTPSERVERS="" +<%= + out = [] + if fqdn == "ancina.debian.org" + ntpservers = %w{ntp.ugent.be} + else + ntpservers = %w{merikanto.debian.org orff.debian.org ravel.debian.org busoni.debian.org} + end + + require 'resolv' + ntpservers.each do |n| + begin + ip = Resolv.getaddress(n) + out << "NTPSERVERS=\"$NTPSERVERS #{ip}\" # #{n}" + rescue Resolv::ResolvError => e + out << "# Failed to resolve #{n}" + end + end + out.join("\n") +%> # Additional options to pass to ntpdate -NTPOPTIONS="" +NTPOPTIONS="-u" # work around broken firewalls