<% if is_virtual == "true" -%>
# Don't mind if the virtualized clock appears to be behaving erratically.
tinker panic 0

<% end -%>
# By default deny everything
restrict default ignore
restrict -6 default ignore

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1

# Drift file.
driftfile /var/lib/ntp/ntp.drift

# Remote servers.
<% ntp_server.each do |server| -%>
restrict <%= server %> mask 255.255.255.255 nomodify notrap noquery
server <%= server %>
<% end -%>
<% if is_virtual == "false" -%>

# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available.
server 127.127.1.0
fudge  127.127.1.0 stratum 10
<% end -%>
<% if has_variable?("ntp_client_networks") -%>

# Restrictions for clients using us as source.
<%     ntp_client_networks.each do |net| -%>
restrict <%= net.split("/")[0] %> mask <%= net.split("/")[1] %> nomodify notrap
<%     end -%>
<% end -%>
