Skip to content

Commit

Permalink
MODULES-1836 - Added support for peers
Browse files Browse the repository at this point in the history
  • Loading branch information
anthcourtney authored and Morgan Haskel committed Apr 8, 2015
1 parent 286acba commit 0b3eac9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ Tells Puppet what NTP package to manage. Valid options: string. Default value: '

Specifies whether NTP should "panic" in the event of a very large clock skew. Valid options: 'true' or 'false'. Default value: 'true' (except on virtual machines, where major time shifts are normal)

####`peers`

List of ntp servers which the local clock can be synchronised against, or which can synchronise against the local clock.

####`preferred_servers`

Specifies one or more preferred peers. Puppet will append 'prefer' to each matching item in the `servers` array. Valid options: array. Default value: [ ]
Expand Down
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
$package_manage = $ntp::params::package_manage,
$package_name = $ntp::params::package_name,
$panic = $ntp::params::panic,
$peers = $ntp::params::peers,
$preferred_servers = $ntp::params::preferred_servers,
$restrict = $ntp::params::restrict,
$interfaces = $ntp::params::interfaces,
Expand All @@ -26,7 +27,7 @@
$service_ensure = $ntp::params::service_ensure,
$service_manage = $ntp::params::service_manage,
$service_name = $ntp::params::service_name,
$udlc = $ntp::params::udlc
$udlc = $ntp::params::udlc,
) inherits ntp::params {

validate_bool($broadcastclient)
Expand Down Expand Up @@ -55,6 +56,7 @@
validate_bool($service_manage)
validate_string($service_name)
validate_bool($udlc)
validate_array($peers)

if $autoupdate {
notice('autoupdate parameter has been deprecated and replaced with package_ensure. Set this to latest for the same behavior as autoupdate => true.')
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
$keys_trusted = []
$logfile = undef
$package_ensure = 'present'
$peers = []
$preferred_servers = []
$service_enable = true
$service_ensure = 'running'
Expand Down
7 changes: 7 additions & 0 deletions templates/ntp.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ driftfile <%= @driftfile %>
logfile <%= @logfile %>
<% end -%>
<% unless @peers.empty? -%>
# Peers
<% [@peers].flatten.each do |peer| -%>
peer <%= peer %>
<% end -%>
<% end -%>
<% if @keys_enable -%>
keys <%= @keys_file %>
<% unless @keys_trusted.empty? -%>
Expand Down

0 comments on commit 0b3eac9

Please sign in to comment.