# EOLE chrony configuration. See chrony.conf(5) for details.

# Keep Ubuntu-provided NTS/pool sources available unless overridden locally.
sourcedir /etc/chrony/sources.d

# EOLE configured time references.
%for %%ntp_iter in %%serveur_ntp
server %%ntp_iter iburst
%end for

%if %%getVar('use_fallback_ntp_pool', 'oui') == 'oui'
pool %%fallback_ntp_pool iburst maxsources 4
%end if

%if %%getVar('activer_ad_smb', 'non') == 'oui'
# Signed NTP for Samba Active Directory clients.
ntpsigndsocket /var/lib/samba/ntp_signd
%end if

keyfile /etc/chrony/chrony.keys
driftfile /var/lib/chrony/chrony.drift
logdir /var/log/chrony
maxupdateskew 100.0
rtcsync

# Allow NTP clients on configured local networks.
%for %%interface in range(0, %%int(%%nombre_interfaces)):
%set %%current_interface = 'eth' + %%str(%%interface)
%set %%network = %%getVar('adresse_network_' + %%current_interface)
%set %%netmask = %%getVar('adresse_netmask_' + %%current_interface)
allow %%network/%%calc_classe(%%netmask)
%end for

%if %%getVar('ntp_allow_directives', 'non') == 'oui'
%for %%ntp_allow_iter in %%ntp_allow
allow %%ntp_allow_iter
%end for
%end if
