X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fntpdate%2Ftemplates%2Fetc-default-ntpdate.erb;h=ee12a56797bf9afff9fa05dd4cfc73b75f77d99c;hb=c429f34b4841fc1c41eac251fc2e9203704b1164;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..ee12a5679 100644 --- a/modules/ntpdate/templates/etc-default-ntpdate.erb +++ b/modules/ntpdate/templates/etc-default-ntpdate.erb @@ -11,11 +11,21 @@ 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 = [] + + require 'resolv' + scope.lookupvar('ntpservers').to_a.flatten.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