ntp: Fixed IPv6 for isc-ntpd, template cleanup

This commit is contained in:
Ossi Salmi 2013-05-08 23:00:51 +03:00
parent e7aa487fc9
commit a7085698dc

View file

@ -1,10 +1,10 @@
<% if is_virtual == "true" -%> <% if @is_virtual == "true" -%>
# Don't mind if the virtualized clock appears to be behaving erratically. # Don't mind if the virtualized clock appears to be behaving erratically.
tinker panic 0 tinker panic 0
<% end -%> <% end -%>
# By default deny everything # By default deny everything.
restrict default ignore restrict -4 default ignore
restrict -6 default ignore restrict -6 default ignore
# Local users may interrogate the ntp server more closely. # Local users may interrogate the ntp server more closely.
@ -15,21 +15,22 @@ restrict ::1
driftfile /var/lib/ntp/ntp.drift driftfile /var/lib/ntp/ntp.drift
# Remote servers. # Remote servers.
<% ntp_server.each do |server| -%> <% @ntp_server.each do |server| -%>
restrict <%= server %> mask 255.255.255.255 nomodify notrap noquery
server <%= server %> server <%= server %>
restrict <%= server %> nomodify notrap nopeer noquery
<% end -%> <% end -%>
<% if is_virtual == "false" -%> <% if @is_virtual == "false" -%>
# Undisciplined Local Clock. This is a fake driver intended for backup # Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. # and when no outside source of synchronized time is available.
server 127.127.1.0 server 127.127.1.0
fudge 127.127.1.0 stratum 10 fudge 127.127.1.0 stratum 10
<% end -%> <% end -%>
<% if has_variable?("ntp_client_networks") -%> <% if @ntp_client_networks -%>
# Restrictions for clients using us as source. # Restrictions for clients using us as source.
<% ntp_client_networks.each do |net| -%> <% @ntp_client_networks.each do |net| -%>
restrict <%= net.split("/")[0] %> mask <%= net.split("/")[1] %> nomodify notrap <% addr, mask = net.split("/") -%>
<% end -%> restrict <%= addr %> mask <%= mask %> nomodify notrap nopeer
<% end -%>
<% end -%> <% end -%>