Skip to content

Commit

Permalink
Merge pull request #32 from johnwarburton/master
Browse files Browse the repository at this point in the history
support for peers, variable local stratum, SUSE 12
  • Loading branch information
aboe76 authored Sep 27, 2018
2 parents 57ae347 + 159eed6 commit edfa874
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 4 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ This determines which template puppet should use for the chrony key file.

An array of key lines. These are printed as-is into the chrony key file.

#### `local_stratum`

Override the stratum of the server which will be reported to clients
when the local reference is active. Defaults to 10

#### `log_options`

Specify which information is to be logged.
Expand All @@ -172,9 +177,14 @@ chrony package to be installed.

This determines the name of the package to install.

#### `peers`

This selects the servers to use for NTP peers (symmetric association).
It is an array of servers.

#### `servers`

This selects the servers to use for ntp peers. It can be an array of servers
This selects the servers to use for NTP servers. It can be an array of servers
or a hash of servers to their respective options.

#### `makestep_updates`, `makestep_seconds`
Expand Down Expand Up @@ -229,3 +239,4 @@ The module has been tested on:
* Arch Linux
* Red Hat
* Debian (9)
* Suse 12.3
1 change: 1 addition & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
$mailonchange = $chrony::mailonchange,
$threshold = $chrony::threshold,
$lock_all = $chrony::lock_all,
$peers = $chrony::peers,
$servers = $chrony::servers,) inherits chrony {
file { $config:
ensure => file,
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
$config_keys_mode = $chrony::params::config_keys_mode,
$config_keys_manage = $chrony::params::config_keys_manage,
$keys = $chrony::params::keys,
$local_stratum = $chrony::params::local_stratum,
$log_options = $chrony::params::log_options,
$package_ensure = $chrony::params::package_ensure,
$package_name = $chrony::params::package_name,
$refclocks = $chrony::params::refclocks,
$peers = $chrony::params::peers,
$servers = $chrony::params::servers,
$makestep_seconds = $chrony::params::makestep_seconds,
$makestep_updates = $chrony::params::makestep_updates,
Expand Down
4 changes: 3 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
$log_options = undef
$package_ensure = 'present'
$refclocks = []
$peers = []
$service_enable = true
$service_ensure = 'running'
$service_manage = true
$chrony_password = 'xyzzy'
$queryhosts = []
$local_stratum = 10
$port = 0
$config_keys_manage = true
$mailonchange = undef
Expand All @@ -27,7 +29,7 @@
$service_name = 'chrony'
$clientlog = true
}
'RedHat' : {
'Suse', 'RedHat' : {
$config = '/etc/chrony.conf'
$config_template = 'chrony/chrony.conf.redhat.erb'
$config_keys = '/etc/chrony.keys'
Expand Down
6 changes: 5 additions & 1 deletion templates/chrony.conf.debian.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ server <%= server %> <%= @servers[server].join(' ') %>
server <%= server %> iburst
<% end end -%>

<% Array(@peers).each do |peer| -%>
peer <%= peer %>
<% end -%>

# Ignore stratum in source selection.
stratumweight 0

Expand Down Expand Up @@ -33,7 +37,7 @@ bindcmdaddress ::1
port <%= @port %>

# Serve time even if not synchronized to any NTP server.
local stratum 10
local stratum <%= @local_stratum %>

keyfile <%= @config_keys %>

Expand Down
6 changes: 5 additions & 1 deletion templates/chrony.conf.redhat.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ server <%= server %> <%= @servers[server].join(' ') %>
server <%= server %> iburst
<% end end -%>

<% Array(@peers).each do |peer| -%>
peer <%= peer %>
<% end -%>

# Ignore stratum in source selection.
stratumweight 0

Expand Down Expand Up @@ -33,7 +37,7 @@ bindcmdaddress ::1
port <%= @port %>

# Serve time even if not synchronized to any NTP server.
local stratum 10
local stratum <%= @local_stratum %>

keyfile <%= @config_keys %>

Expand Down

0 comments on commit edfa874

Please sign in to comment.