# {{ ansible_managed }}

{% for value in timesync_ntp_servers %}
{{ 'pool' if 'pool' in value and value['pool'] else 'server' }} {{
value['hostname'] }}{{
' minpoll {0}'.format(value['minpoll']) if 'minpoll' in value else '' }}{{
' maxpoll {0}'.format(value['maxpoll']) if 'maxpoll' in value else '' }}{{
' iburst' if 'iburst' in value and value else '' }}
{% endfor %}

driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default nomodify notrap nopeer noquery
{% if timesync_ntp_version.stdout|version_compare('4.2.6', '<') %}
restrict -6 default nomodify notrap nopeer noquery
{% endif %}

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1 
restrict ::1

{% if timesync_step_threshold >= 0.0 %}
# Specify the step threshold.
tinker step {{ timesync_step_threshold }}

{% endif %}
{% if timesync_min_sources > 1 %}
# Increase the minimum number of selectable sources required to adjust
# the system clock.
tos minsane {{ timesync_min_sources }}

{% endif %}
