Skip to content

Commit

Permalink
add minpoll/maxpoll for ntp.conf generation
Browse files Browse the repository at this point in the history
  • Loading branch information
bsun-sudo committed Sep 1, 2023
1 parent 16321fd commit 7cfa9c9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion files/image_config/ntp/ntp.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ filegen clockstats file clockstats type day enable
# pick a different set every time it starts up. Please consider joining the
# pool: <http://www.pool.ntp.org/join.html>
{% for ntp_server in NTP_SERVER %}
server {{ ntp_server }} iburst
{% set ns = namespace(minpoll='') %}
{% if NTP_SERVER[ntp_server]['minpoll'] %}
{% set ns.minpoll = "minpoll " + NTP_SERVER[ntp_server]['minpoll'] %}
{% endif %}
{% if NTP_SERVER[ntp_server]['maxpoll'] %}
{% set ns.maxpoll = "maxpoll " + NTP_SERVER[ntp_server]['maxpoll'] %}
{% endif %}
server {{ ntp_server }} iburst {{ ns.minpoll }} {{ns.maxpoll}}
{% endfor %}

#listen on source interface if configured, else
Expand Down

0 comments on commit 7cfa9c9

Please sign in to comment.