Skip to content

Commit

Permalink
Added pool support (#377)
Browse files Browse the repository at this point in the history
Added the pool param to ntp class.
  • Loading branch information
gknight007 authored and wilson208 committed Mar 10, 2017
1 parent 2389889 commit 493cdb8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 8 additions & 0 deletions templates/ntp.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {-%>
Expand Down

0 comments on commit 493cdb8

Please sign in to comment.