diff --git a/defaults/main.yml b/defaults/main.yml index e03d3cc..b588e1b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,9 +1,13 @@ --- -chrony_ntpservers: - - 0.centos.pool.ntp.org - - 1.centos.pool.ntp.org - - 2.centos.pool.ntp.org - - 3.centos.pool.ntp.org +#chrony_ntpservers: +# - 0.centos.pool.ntp.org +# - 1.centos.pool.ntp.org +# - 2.centos.pool.ntp.org +# - 3.centos.pool.ntp.org +chrony_ntppools: + - 1.pool.ntp.org + - 2.pool.ntp.org + - 3.pool.ntp.org chrony_allowclients: false #chrony_clients: # - 192.168.0.0/24 diff --git a/templates/chrony.conf.j2 b/templates/chrony.conf.j2 index a894323..12f4a2e 100644 --- a/templates/chrony.conf.j2 +++ b/templates/chrony.conf.j2 @@ -1,8 +1,17 @@ # Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). +{% if chrony_ntpservers is defined or chrony_ntppools is defined %} +{% if chrony_ntpservers is defined %} {% for ntpserver in chrony_ntpservers %} server {{ ntpserver }} iburst {% endfor %} +{% endif %} +{% if chrony_ntppools is defined %} +{% for ntppool in chrony_ntppools %} +pool {{ ntppool }} iburst +{% endfor %} +{% endif %} +{% endif %} {% if chrony_clients is defined %} # Ignore stratum in source selection.