Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added pool support #377

Merged
merged 3 commits into from
Mar 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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