diff --git a/data/common.yaml b/data/common.yaml index 5242aecb..bece6812 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -31,6 +31,7 @@ ntp::package_manage: true ntp::package_name: [ 'ntp' ] ntp::panic: ~ ntp::peers: [] +ntp::pool: [] ntp::preferred_servers: [] ntp::servers: - '0.pool.ntp.org' diff --git a/manifests/init.pp b/manifests/init.pp index 2d3d5890..dbeed50e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -34,6 +34,7 @@ # @param package_name [Array[String]] Specifies the NTP package to manage. Default value: ['ntp'] (except on AIX and Solaris). # @param panic [Optional Integer[0]] Whether NTP should "panic" in the event of a very large clock skew. Applies only if `tinker` option set to true or if your environment is in a virtual machine. Default value: 0 if environment is virtual, undef in all other cases. # @param peers [Array[String]] List of NTP servers with which to synchronise the local clock. +# @param pool [Array[String]] List of NTP server pools with which to synchronise the local clock. # @param preferred_servers [Array[String] Specifies one or more preferred peers. Puppet appends 'prefer' to each matching item in the `servers` array. Default value: [ ]. # @param restrict [Array[String]] Specifies one or more `restrict` options for the NTP configuration. Puppet prefixes each item with 'restrict', so you need to list only the content of the restriction. Default value for most operating systems: '[default kod nomodify notrap nopeer noquery', '-6 default kod nomodify notrap nopeer noquery', '127.0.0.1', '-6 ::1']`. Default value for AIX systems: `['default nomodify notrap nopeer noquery', '127.0.0.1',]`. # @param servers [Array[String]] Specifies one or more servers to be used as NTP peers. Default value: varies by operating system. @@ -86,6 +87,7 @@ Array[String] $package_name, Optional[Integer[0]] $panic, Array[String] $peers, + Optional[Array[String]] $pool, Array[String] $preferred_servers, Array[String] $restrict, Array[String] $interfaces, diff --git a/templates/ntp.conf.epp b/templates/ntp.conf.epp index e25c4145..48b4cdd9 100644 --- a/templates/ntp.conf.epp +++ b/templates/ntp.conf.epp @@ -93,6 +93,14 @@ peer <%= $peer %> <% } -%> <% } -%> +<% unless $ntp::pool.empty {-%> +# Pool +<% $ntp::pool.each |$pool_srv| {-%> +pool <%= $pool_srv %> +<% } -%> +<% } -%> + + <% if $ntp::keys_enable {-%> keys <%= $ntp::keys_file %> <% unless $ntp::keys_trusted.empty {-%>