diff --git a/README.md b/README.md index 60ed8d3..583e9ce 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,11 @@ Set the [NTP Pool Area](http://support.ntp.org/bin/view/Servers/NTPPoolServers) - "2{{ '.' + ntp_area if ntp_area else '' }}.pool.ntp.org iburst" - "3{{ '.' + ntp_area if ntp_area else '' }}.pool.ntp.org iburst" +Set the non-pool NTP servers to use. Defaults to none. + + ntp_servers_non_pool: + - "ntp.ubuntu.com" + Specify the NTP servers you'd like to use. Only takes effect if you allow this role to manage NTP's configuration, by setting `ntp_manage_config` to `True`. ntp_restrict: diff --git a/defaults/main.yml b/defaults/main.yml index 4c1fd82..02dbe21 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -18,6 +18,9 @@ ntp_servers: - "2{{ '.' + ntp_area if ntp_area else '' }}.pool.ntp.org iburst" - "3{{ '.' + ntp_area if ntp_area else '' }}.pool.ntp.org iburst" +# Single (non-pooled) NTP servers +ntp_servers_non_pool: [] + ntp_restrict: - "127.0.0.1" - "::1" diff --git a/templates/chrony.conf.j2 b/templates/chrony.conf.j2 index 4d80b94..5b83f60 100644 --- a/templates/chrony.conf.j2 +++ b/templates/chrony.conf.j2 @@ -4,6 +4,9 @@ {% for server in ntp_servers %} server {{ server }} {% endfor %} +{% for server in ntp_servers_non_pool %} +server {{ server }} +{% endfor %} # Use public servers from the pool.ntp.org project. # Please consider joining the pool (http://www.pool.ntp.org/join.html). diff --git a/templates/ntp.conf.j2 b/templates/ntp.conf.j2 index ddaa6f3..5d61e3b 100644 --- a/templates/ntp.conf.j2 +++ b/templates/ntp.conf.j2 @@ -26,6 +26,10 @@ tinker panic 0 pool {{ item }} {% endfor %} +{% for item in ntp_servers_non_pool %} +server {{ item }} +{% endfor %} + # 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