Compare commits
6 Commits
ef549cf412
...
ea7e79203b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea7e79203b | ||
|
|
cd29151c6b | ||
| 281ce8ac26 | |||
| a978d1c95b | |||
| 19ca664819 | |||
|
|
f378cb6d88 |
@@ -30,13 +30,20 @@ Time management in Linux is important. The underlying protocol is ntp, the servi
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
This module differentiates between client- and server configuration. If the `FQDN` of the puppet client matches the value of `cy_server_fqdn`, it assumes this to be an ntp time server, else it will be a client.
|
||||||
|
|
||||||
|
If you have no local time server(s), leave the default for `cy_server_fqdn`.
|
||||||
|
|
||||||
|
The value for `cy_server_fqdn` is a string rather array, assuming either a single time server or a round-robin DNS entry for this, returning several values for the time server (not configured by this module).
|
||||||
|
|
||||||
INSTALLATION
|
INSTALLATION
|
||||||
|
|
||||||
- installs chrony binaries
|
- installs chrony binaries
|
||||||
|
|
||||||
CONFIGURATION
|
CONFIGURATION
|
||||||
|
|
||||||
- manage directories and files including templates
|
- manage directories including selinux contexts
|
||||||
|
- and files and their templates including selinux contexts
|
||||||
- manage service
|
- manage service
|
||||||
- optional: include nagios target for the chrony service (set `cy_manage_nagios`to `true`)
|
- optional: include nagios target for the chrony service (set `cy_manage_nagios`to `true`)
|
||||||
|
|
||||||
|
|||||||
@@ -103,6 +103,12 @@
|
|||||||
|
|
||||||
<h2 id="label-Features">Features</h2>
|
<h2 id="label-Features">Features</h2>
|
||||||
|
|
||||||
|
<p>This module differentiates between client- and server configuration. If the <code>FQDN</code> of the puppet client matches the value of <code>cy_server_fqdn</code>, it assumes this to be an ntp time server, else it will be a client.</p>
|
||||||
|
|
||||||
|
<p>If you have no local time server(s), leave the default for <code>cy_server_fqdn</code>.</p>
|
||||||
|
|
||||||
|
<p>The value for <code>cy_server_fqdn</code> is a string rather array, assuming either a single time server or a round-robin DNS entry for this, returning several values for the time server (not configured by this module).</p>
|
||||||
|
|
||||||
<p>INSTALLATION</p>
|
<p>INSTALLATION</p>
|
||||||
<ul><li>
|
<ul><li>
|
||||||
<p>installs chrony binaries</p>
|
<p>installs chrony binaries</p>
|
||||||
@@ -110,7 +116,9 @@
|
|||||||
|
|
||||||
<p>CONFIGURATION</p>
|
<p>CONFIGURATION</p>
|
||||||
<ul><li>
|
<ul><li>
|
||||||
<p>manage directories and files including templates</p>
|
<p>manage directories including selinux contexts</p>
|
||||||
|
</li><li>
|
||||||
|
<p>and files and their templates including selinux contexts</p>
|
||||||
</li><li>
|
</li><li>
|
||||||
<p>manage service</p>
|
<p>manage service</p>
|
||||||
</li><li>
|
</li><li>
|
||||||
|
|||||||
@@ -103,6 +103,12 @@
|
|||||||
|
|
||||||
<h2 id="label-Features">Features</h2>
|
<h2 id="label-Features">Features</h2>
|
||||||
|
|
||||||
|
<p>This module differentiates between client- and server configuration. If the <code>FQDN</code> of the puppet client matches the value of <code>cy_server_fqdn</code>, it assumes this to be an ntp time server, else it will be a client.</p>
|
||||||
|
|
||||||
|
<p>If you have no local time server(s), leave the default for <code>cy_server_fqdn</code>.</p>
|
||||||
|
|
||||||
|
<p>The value for <code>cy_server_fqdn</code> is a string rather array, assuming either a single time server or a round-robin DNS entry for this, returning several values for the time server (not configured by this module).</p>
|
||||||
|
|
||||||
<p>INSTALLATION</p>
|
<p>INSTALLATION</p>
|
||||||
<ul><li>
|
<ul><li>
|
||||||
<p>installs chrony binaries</p>
|
<p>installs chrony binaries</p>
|
||||||
@@ -110,7 +116,9 @@
|
|||||||
|
|
||||||
<p>CONFIGURATION</p>
|
<p>CONFIGURATION</p>
|
||||||
<ul><li>
|
<ul><li>
|
||||||
<p>manage directories and files including templates</p>
|
<p>manage directories including selinux contexts</p>
|
||||||
|
</li><li>
|
||||||
|
<p>and files and their templates including selinux contexts</p>
|
||||||
</li><li>
|
</li><li>
|
||||||
<p>manage service</p>
|
<p>manage service</p>
|
||||||
</li><li>
|
</li><li>
|
||||||
|
|||||||
@@ -152,7 +152,7 @@
|
|||||||
<span class='type'>(<tt>String</tt>)</span>
|
<span class='type'>(<tt>String</tt>)</span>
|
||||||
|
|
||||||
|
|
||||||
<em class="default">(defaults to: <tt>'ntp.example.com'</tt>)</em>
|
<em class="default">(defaults to: <tt>'ntp.example.local'</tt>)</em>
|
||||||
|
|
||||||
|
|
||||||
—
|
—
|
||||||
@@ -176,6 +176,96 @@
|
|||||||
—
|
—
|
||||||
<div class='inline'>
|
<div class='inline'>
|
||||||
<p>List of NTP servers to point to as time source</p>
|
<p>List of NTP servers to point to as time source</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
|
||||||
|
<span class='name'>cy_min_sources</span>
|
||||||
|
|
||||||
|
|
||||||
|
<span class='type'>(<tt>String</tt>)</span>
|
||||||
|
|
||||||
|
|
||||||
|
<em class="default">(defaults to: <tt>'3'</tt>)</em>
|
||||||
|
|
||||||
|
|
||||||
|
—
|
||||||
|
<div class='inline'>
|
||||||
|
<p>Minimum number of selectable sources required to adjust the system clock. Primarily used for servers.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
|
||||||
|
<span class='name'>cy_client_allow</span>
|
||||||
|
|
||||||
|
|
||||||
|
<span class='type'>(<tt>String</tt>)</span>
|
||||||
|
|
||||||
|
|
||||||
|
<em class="default">(defaults to: <tt>'192.168.1.0/24'</tt>)</em>
|
||||||
|
|
||||||
|
|
||||||
|
—
|
||||||
|
<div class='inline'>
|
||||||
|
<p>CIDR notation for allowed client networks</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
|
||||||
|
<span class='name'>cy_leapsec_mode</span>
|
||||||
|
|
||||||
|
|
||||||
|
<span class='type'>(<tt>String</tt>)</span>
|
||||||
|
|
||||||
|
|
||||||
|
<em class="default">(defaults to: <tt>'slew'</tt>)</em>
|
||||||
|
|
||||||
|
|
||||||
|
—
|
||||||
|
<div class='inline'>
|
||||||
|
<p>Leap second handling mode. Valid values are ‘slew’ or ‘step’.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
|
||||||
|
<span class='name'>cy_leapsectz</span>
|
||||||
|
|
||||||
|
|
||||||
|
<span class='type'>(<tt>String</tt>)</span>
|
||||||
|
|
||||||
|
|
||||||
|
<em class="default">(defaults to: <tt>'right/UTC'</tt>)</em>
|
||||||
|
|
||||||
|
|
||||||
|
—
|
||||||
|
<div class='inline'>
|
||||||
|
<p>Leap second timezone file to use.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
|
||||||
|
<span class='name'>cy_loginfo</span>
|
||||||
|
|
||||||
|
|
||||||
|
<span class='type'>(<tt>String</tt>)</span>
|
||||||
|
|
||||||
|
|
||||||
|
<em class="default">(defaults to: <tt>'measurements statistics tracking'</tt>)</em>
|
||||||
|
|
||||||
|
|
||||||
|
—
|
||||||
|
<div class='inline'>
|
||||||
|
<p>Log information to record. Valid values are ‘measurements’, ‘statistics’, and ‘tracking’.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
@@ -191,14 +281,6 @@
|
|||||||
<pre class="lines">
|
<pre class="lines">
|
||||||
|
|
||||||
|
|
||||||
13
|
|
||||||
14
|
|
||||||
15
|
|
||||||
16
|
|
||||||
17
|
|
||||||
18
|
|
||||||
19
|
|
||||||
20
|
|
||||||
21
|
21
|
||||||
22
|
22
|
||||||
23
|
23
|
||||||
@@ -219,10 +301,23 @@
|
|||||||
38
|
38
|
||||||
39
|
39
|
||||||
40
|
40
|
||||||
41</pre>
|
41
|
||||||
|
42
|
||||||
|
43
|
||||||
|
44
|
||||||
|
45
|
||||||
|
46
|
||||||
|
47
|
||||||
|
48
|
||||||
|
49
|
||||||
|
50
|
||||||
|
51
|
||||||
|
52
|
||||||
|
53
|
||||||
|
54</pre>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 13</span>
|
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 21</span>
|
||||||
|
|
||||||
class confdroid_ntp::params (
|
class confdroid_ntp::params (
|
||||||
|
|
||||||
@@ -231,8 +326,13 @@ class confdroid_ntp::params (
|
|||||||
String $cy_pkg_ensure = 'present',
|
String $cy_pkg_ensure = 'present',
|
||||||
|
|
||||||
# configuration
|
# configuration
|
||||||
String $cy_server_fqdn = 'ntp.example.com',
|
String $cy_server_fqdn = 'ntp.example.local',
|
||||||
Array $cy_conf_servers = ['0.pool.ntp.org', '1.pool.ntp.org', '2.pool.ntp.org', '3.pool.ntp.org'],
|
Array $cy_conf_servers = ['0.pool.ntp.org', '1.pool.ntp.org', '2.pool.ntp.org', '3.pool.ntp.org'],
|
||||||
|
String $cy_min_sources = '3',
|
||||||
|
String $cy_client_allow = '192.168.1.0/24',
|
||||||
|
String $cy_leapsec_mode = 'slew',
|
||||||
|
String $cy_leapsectz = 'right/UTC',
|
||||||
|
String $cy_loginfo = 'measurements statistics tracking',
|
||||||
|
|
||||||
) {
|
) {
|
||||||
# facts
|
# facts
|
||||||
|
|||||||
@@ -9,6 +9,14 @@
|
|||||||
# If the fqdn of the host matches this value, a time server will be
|
# If the fqdn of the host matches this value, a time server will be
|
||||||
# configured, else a client.
|
# configured, else a client.
|
||||||
# @param [Array] cy_conf_servers List of NTP servers to point to as time source
|
# @param [Array] cy_conf_servers List of NTP servers to point to as time source
|
||||||
|
# @param [String] cy_min_sources Minimum number of selectable sources required
|
||||||
|
# to adjust the system clock. Primarily used for servers.
|
||||||
|
# @param [String] cy_client_allow CIDR notation for allowed client networks
|
||||||
|
# @param [String] cy_leapsec_mode Leap second handling mode. Valid values are
|
||||||
|
# 'slew' or 'step'.
|
||||||
|
# @param [String] cy_leapsectz Leap second timezone file to use.
|
||||||
|
# @param [String] cy_loginfo Log information to record. Valid values are
|
||||||
|
# 'measurements', 'statistics', and 'tracking'.
|
||||||
###############################################################################
|
###############################################################################
|
||||||
class confdroid_ntp::params (
|
class confdroid_ntp::params (
|
||||||
|
|
||||||
@@ -17,8 +25,13 @@ class confdroid_ntp::params (
|
|||||||
String $cy_pkg_ensure = 'present',
|
String $cy_pkg_ensure = 'present',
|
||||||
|
|
||||||
# configuration
|
# configuration
|
||||||
String $cy_server_fqdn = 'ntp.example.com',
|
String $cy_server_fqdn = 'ntp.example.local',
|
||||||
Array $cy_conf_servers = ['0.pool.ntp.org', '1.pool.ntp.org', '2.pool.ntp.org', '3.pool.ntp.org'],
|
Array $cy_conf_servers = ['0.pool.ntp.org', '1.pool.ntp.org', '2.pool.ntp.org', '3.pool.ntp.org'],
|
||||||
|
String $cy_min_sources = '3',
|
||||||
|
String $cy_client_allow = '192.168.1.0/24',
|
||||||
|
String $cy_leapsec_mode = 'slew',
|
||||||
|
String $cy_leapsectz = 'right/UTC',
|
||||||
|
String $cy_loginfo = 'measurements statistics tracking',
|
||||||
|
|
||||||
) {
|
) {
|
||||||
# facts
|
# facts
|
||||||
|
|||||||
@@ -21,6 +21,43 @@ driftfile /var/lib/chrony/drift
|
|||||||
# if its offset is larger than 1 second.
|
# if its offset is larger than 1 second.
|
||||||
makestep 1.0 3
|
makestep 1.0 3
|
||||||
|
|
||||||
|
# Enable kernel synchronization of the real-time clock (RTC).
|
||||||
|
rtcsync
|
||||||
|
|
||||||
|
# Enable hardware timestamping on all interfaces that support it.
|
||||||
|
hwtimestamp *
|
||||||
|
|
||||||
|
# Increase the minimum number of selectable sources required to adjust
|
||||||
|
# the system clock.
|
||||||
|
minsources <%= @cy_min_sources %>
|
||||||
|
|
||||||
|
# Allow NTP client access from local network.
|
||||||
|
allow <%= @cy_client_allow %>
|
||||||
|
|
||||||
|
# Serve time even if not synchronized to a time source.
|
||||||
|
local stratum 10
|
||||||
|
|
||||||
|
# Require authentication (nts or key option) for all NTP sources.
|
||||||
|
#authselectmode require
|
||||||
|
|
||||||
|
# Specify file containing keys for NTP authentication.
|
||||||
|
keyfile /etc/chrony.keys
|
||||||
|
|
||||||
|
# Save NTS keys and cookies.
|
||||||
|
ntsdumpdir /var/lib/chrony
|
||||||
|
|
||||||
|
# Insert/delete leap seconds by slewing instead of stepping.
|
||||||
|
leapsecmode <%= @cy_leapsec_mode %>
|
||||||
|
|
||||||
|
# Get TAI-UTC offset and leap seconds from the system tz database.
|
||||||
|
leapsectz <%= @cy_leapsectz %>
|
||||||
|
|
||||||
|
# Specify directory for log files.
|
||||||
|
logdir /var/log/chrony
|
||||||
|
|
||||||
|
# Select which information is logged.
|
||||||
|
log <%= @cy_loginfo %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
@@ -38,4 +75,41 @@ driftfile /var/lib/chrony/drift
|
|||||||
# if its offset is larger than 1 second.
|
# if its offset is larger than 1 second.
|
||||||
makestep 1.0 3
|
makestep 1.0 3
|
||||||
|
|
||||||
|
# Enable kernel synchronization of the real-time clock (RTC).
|
||||||
|
rtcsync
|
||||||
|
|
||||||
|
# Enable hardware timestamping on all interfaces that support it.
|
||||||
|
hwtimestamp *
|
||||||
|
|
||||||
|
# Increase the minimum number of selectable sources required to adjust
|
||||||
|
# the system clock. Primarily for servers.
|
||||||
|
#minsources 2
|
||||||
|
|
||||||
|
# Allow NTP client access from local network.
|
||||||
|
#allow 192.168.0.0/16
|
||||||
|
|
||||||
|
# Serve time even if not synchronized to a time source.
|
||||||
|
#local stratum 10
|
||||||
|
|
||||||
|
# Require authentication (nts or key option) for all NTP sources.
|
||||||
|
#authselectmode require
|
||||||
|
|
||||||
|
# Specify file containing keys for NTP authentication.
|
||||||
|
keyfile /etc/chrony.keys
|
||||||
|
|
||||||
|
# Save NTS keys and cookies.
|
||||||
|
ntsdumpdir /var/lib/chrony
|
||||||
|
|
||||||
|
# Insert/delete leap seconds by slewing instead of stepping.
|
||||||
|
leapsecmode <%= @cy_leapsec_mode %>
|
||||||
|
|
||||||
|
# Get TAI-UTC offset and leap seconds from the system tz database.
|
||||||
|
leapsectz <%= @cy_leapsectz %>
|
||||||
|
|
||||||
|
# Specify directory for log files.
|
||||||
|
logdir /var/log/chrony
|
||||||
|
|
||||||
|
# Select which information is logged.
|
||||||
|
log <%= @cy_loginfo %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user