Compare commits

..

87 Commits

Author SHA1 Message Date
Jenkins Server
43fc9c480f Recommit for updates in build 40 2026-10-04 16:17:56 +02:00
Jenkins Server
b3cf618c11 Merge remote-tracking branch 'origin/master' into jenkins-build-40 2026-10-04 16:17:05 +02:00
a73a61d814 OP#830 change targets 2026-10-04 16:16:47 +02:00
Jenkins Server
ea189002e9 Recommit for updates in build 39 2026-10-04 15:57:58 +02:00
Jenkins Server
1af8969a1e Merge remote-tracking branch 'origin/master' into jenkins-build-39 2026-10-04 15:57:10 +02:00
334ab846e6 OP#830 change targets 2026-10-04 15:56:57 +02:00
Jenkins Server
1a473ef93f Recommit for updates in build 38 2026-10-04 15:48:44 +02:00
Jenkins Server
0ac6f85be3 Merge remote-tracking branch 'origin/master' into jenkins-build-38 2026-10-04 15:47:50 +02:00
9d1da425aa OP#830 change targets 2026-10-04 15:47:33 +02:00
Jenkins Server
ec53b08630 Recommit for updates in build 37 2026-10-04 15:41:50 +02:00
Jenkins Server
7ad897a119 Merge remote-tracking branch 'origin/master' into jenkins-build-37 2026-10-04 15:41:00 +02:00
d64ff7141b OP#830 fix target module 2026-10-04 15:40:45 +02:00
Jenkins Server
0e199418ed Recommit for updates in build 36 2026-10-04 15:38:45 +02:00
Jenkins Server
8120a82d4b Merge remote-tracking branch 'origin/master' into jenkins-build-36 2026-10-04 15:37:51 +02:00
6d9a7e196d OP#830 fix target module 2026-10-04 15:37:31 +02:00
b97d75b882 OP#830 fix target module 2026-10-04 15:35:57 +02:00
Jenkins Server
4be2f33cca Recommit for updates in build 35 2026-10-04 15:30:42 +02:00
Jenkins Server
cd547aec44 Merge remote-tracking branch 'origin/master' into jenkins-build-35 2026-10-04 15:29:51 +02:00
be2a45c7f8 OP#830 add loki management 2026-10-04 15:29:30 +02:00
Jenkins Server
298e2f0e43 Recommit for updates in build 34 2026-10-04 13:55:13 +02:00
Jenkins Server
24f4cf3e97 Merge remote-tracking branch 'origin/master' into jenkins-build-34 2026-10-04 13:54:25 +02:00
dc86fb5ce8 OP#830 fix process name 2026-10-04 13:54:08 +02:00
Jenkins Server
bff128d55d Recommit for updates in build 33 2026-10-04 13:47:36 +02:00
Jenkins Server
39ab1b1626 Merge remote-tracking branch 'origin/master' into jenkins-build-33 2026-10-04 13:46:50 +02:00
6138fdfcaa OP#830 fix procs:allowed value 2026-10-04 13:46:31 +02:00
Jenkins Server
8c3393b790 Recommit for updates in build 32 2026-10-04 13:33:11 +02:00
Jenkins Server
a5b1106a97 Merge remote-tracking branch 'origin/master' into jenkins-build-32 2026-10-04 13:32:25 +02:00
3e9e52b144 OP#830 add nagios target 2026-10-04 13:32:07 +02:00
Jenkins Server
fc2f9adfe1 Recommit for updates in build 31 2026-10-04 13:27:36 +02:00
Jenkins Server
d5f6a5ceeb Merge remote-tracking branch 'origin/master' into jenkins-build-31 2026-10-04 13:26:50 +02:00
097956676e OP#830 add nagios target 2026-10-04 13:26:33 +02:00
Jenkins Server
561462758d Recommit for updates in build 30 2026-10-04 12:20:51 +02:00
Jenkins Server
09f8a1b1bd Merge remote-tracking branch 'origin/master' into jenkins-build-30 2026-10-04 12:19:55 +02:00
16597c16d5 OP#830 add logrotation file 2026-10-04 12:19:36 +02:00
ceabad8b19 OP#830 add drift file 2026-10-04 12:09:10 +02:00
Jenkins Server
47dc39eb4b Recommit for updates in build 29 2026-10-04 11:59:13 +02:00
Jenkins Server
62060737ac Merge remote-tracking branch 'origin/master' into jenkins-build-29 2026-10-04 11:58:21 +02:00
211341c62c OP#830 fix mode 2026-10-04 11:58:03 +02:00
Jenkins Server
f1a36da305 Recommit for updates in build 28 2026-10-04 11:53:17 +02:00
Jenkins Server
f40ee39597 Merge remote-tracking branch 'origin/master' into jenkins-build-28 2026-10-04 11:52:24 +02:00
f49683ea7f OP#830 fix mode 2026-10-04 11:52:05 +02:00
Jenkins Server
9d9e86e2e8 Recommit for updates in build 27 2026-10-04 11:48:42 +02:00
Jenkins Server
c7860cae1e Merge remote-tracking branch 'origin/master' into jenkins-build-27 2026-10-04 11:47:40 +02:00
2f9039715e OP#830 add run/chrony 2026-10-04 11:47:12 +02:00
7a6ec8a322 OP#830 add run/chrony 2026-10-04 11:46:11 +02:00
Jenkins Server
c6f1a67cd5 Recommit for updates in build 26 2026-10-04 11:35:27 +02:00
Jenkins Server
156f5a7c46 Merge remote-tracking branch 'origin/master' into jenkins-build-26 2026-10-04 11:34:29 +02:00
2a5ef06f36 OP#830 fix seltype 2026-10-04 11:34:10 +02:00
Jenkins Server
76fc3908df Recommit for updates in build 25 2026-10-04 11:21:18 +02:00
Jenkins Server
d78d1f135d Merge remote-tracking branch 'origin/master' into jenkins-build-25 2026-10-04 11:20:21 +02:00
766f4935ef OP#830 add control for directories 2026-10-04 11:19:54 +02:00
Jenkins Server
d3f2356903 Recommit for updates in build 24 2026-10-02 16:06:56 +02:00
Jenkins Server
99c69fba78 Merge remote-tracking branch 'origin/master' into jenkins-build-24 2026-10-02 16:06:10 +02:00
bbc11e96e3 OP#830 add bollean for toggling using lan server 2026-10-02 16:05:55 +02:00
28879cbf65 OP#830 add bollean for toggling using lan server 2026-10-02 16:03:13 +02:00
Jenkins Server
2a707a4bab Recommit for updates in build 22 2026-10-02 15:49:43 +02:00
Jenkins Server
cd29151c6b Merge remote-tracking branch 'origin/master' into jenkins-build-22 2026-10-02 15:48:56 +02:00
281ce8ac26 OP#830 finalize default config values 2026-10-02 15:48:36 +02:00
a978d1c95b OP#830 finalize default config values 2026-10-02 15:37:23 +02:00
19ca664819 OP#830 update Readme 2026-10-02 15:16:47 +02:00
Jenkins Server
f378cb6d88 Merge remote-tracking branch 'origin/master' into jenkins-build-21 2026-10-02 15:10:05 +02:00
d2f608c390 OP#830 add config steps 2026-10-02 15:09:48 +02:00
Jenkins Server
d1b76bdd27 Merge remote-tracking branch 'origin/master' into jenkins-build-20 2026-10-02 15:05:45 +02:00
a09bbd6132 OP#830 add config steps 2026-10-02 15:05:29 +02:00
Jenkins Server
619ae2e63b Merge remote-tracking branch 'origin/master' into jenkins-build-19 2026-10-02 14:56:30 +02:00
526d3909bc OP#830 fqdn pickup working 2026-10-02 14:56:10 +02:00
Jenkins Server
7a62a2336f Merge remote-tracking branch 'origin/master' into jenkins-build-18 2026-10-02 14:53:30 +02:00
babff5c1fb OP#830 testing fqdn pickup 2026-10-02 14:53:12 +02:00
Jenkins Server
5af39664fa Merge remote-tracking branch 'origin/master' into jenkins-build-17 2026-10-02 14:51:34 +02:00
c0efbb69a7 OP#830 testing fqdn pickup 2026-10-02 14:51:21 +02:00
7e4c8b636e OP#830 testing fqdn pickup 2026-10-02 14:49:06 +02:00
5d0f1d1b09 OP#830 testing fqdn pickup 2026-10-02 14:45:12 +02:00
c8849bf93d OP#830 testing fqdn pickup 2026-10-02 14:43:28 +02:00
Jenkins Server
db5b7c746a Merge remote-tracking branch 'origin/master' into jenkins-build-13 2026-10-02 14:39:14 +02:00
530be4b1d3 OP#830 testing fqdn pickup 2026-10-02 14:39:00 +02:00
Jenkins Server
bee4aef695 Merge remote-tracking branch 'origin/master' into jenkins-build-12 2026-10-02 14:33:05 +02:00
131a1f540b OP#830 testing fqdn pickup 2026-10-02 14:32:49 +02:00
Jenkins Server
d44dae81ce Recommit for updates in build 11 2026-10-02 13:59:46 +02:00
Jenkins Server
8f3be68296 Merge remote-tracking branch 'origin/master' into jenkins-build-11 2026-10-02 13:58:59 +02:00
f40927b679 OP#830 testing fqdn pickup 2026-10-02 13:58:42 +02:00
Jenkins Server
33436cf926 Merge remote-tracking branch 'origin/master' into jenkins-build-10 2026-10-02 13:53:29 +02:00
792e812b8b OP#830 testing fqdn pickup 2026-10-02 13:53:13 +02:00
Jenkins Server
e11ff0fece Merge remote-tracking branch 'origin/master' into jenkins-build-9 2026-10-02 13:51:35 +02:00
6603cb6a76 OP#830 testing fqdn pickup 2026-10-02 13:51:16 +02:00
Jenkins Server
1cd3e70afb Merge remote-tracking branch 'origin/master' into jenkins-build-8 2026-10-02 13:46:09 +02:00
0d7cce70d2 OP#830 divide conf file between server and client 2026-10-02 13:45:53 +02:00
Jenkins Server
743e5fc9e2 Recommit for updates in build 7 2026-10-02 13:39:00 +02:00
19 changed files with 878 additions and 54 deletions

View File

@@ -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 `cy_use_lan_server` at `false` (default), else set it to `true`. This affects only client configurations.
The value for `cy_server_fqdn` is a string rather array, assuming either a single time server or a round-robin DNS CNAME entry 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`)

View File

@@ -98,6 +98,11 @@
</li> </li>
<li>
<span class='object_link'><a href="puppet_classes/confdroid_ntp_3A_3Amonitoring_3A_3Aloki.html" title="puppet_classes::confdroid_ntp::monitoring::loki (puppet_class)">confdroid_ntp::monitoring::loki</a></span>
</li>
<li> <li>
<span class='object_link'><a href="puppet_classes/confdroid_ntp_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_ntp::monitoring::target (puppet_class)">confdroid_ntp::monitoring::target</a></span> <span class='object_link'><a href="puppet_classes/confdroid_ntp_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_ntp::monitoring::target (puppet_class)">confdroid_ntp::monitoring::target</a></span>

View File

@@ -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 <code>cy_use_lan_server</code> at <code>false</code> (default), else set it to <code>true</code>. This affects only client configurations.</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 CNAME entry 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>

View File

@@ -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 <code>cy_use_lan_server</code> at <code>false</code> (default), else set it to <code>true</code>. This affects only client configurations.</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 CNAME entry 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>

View File

@@ -78,14 +78,21 @@
</li> </li>
<li id="object_puppet_classes::confdroid_ntp::monitoring::target" class="odd"> <li id="object_puppet_classes::confdroid_ntp::monitoring::loki" class="odd">
<div class="item">
<span class='object_link'><a href="puppet_classes/confdroid_ntp_3A_3Amonitoring_3A_3Aloki.html" title="puppet_classes::confdroid_ntp::monitoring::loki (puppet_class)">confdroid_ntp::monitoring::loki</a></span>
</div>
</li>
<li id="object_puppet_classes::confdroid_ntp::monitoring::target" class="even">
<div class="item"> <div class="item">
<span class='object_link'><a href="puppet_classes/confdroid_ntp_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_ntp::monitoring::target (puppet_class)">confdroid_ntp::monitoring::target</a></span> <span class='object_link'><a href="puppet_classes/confdroid_ntp_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_ntp::monitoring::target (puppet_class)">confdroid_ntp::monitoring::target</a></span>
</div> </div>
</li> </li>
<li id="object_puppet_classes::confdroid_ntp::params" class="even"> <li id="object_puppet_classes::confdroid_ntp::params" class="odd">
<div class="item"> <div class="item">
<span class='object_link'><a href="puppet_classes/confdroid_ntp_3A_3Aparams.html" title="puppet_classes::confdroid_ntp::params (puppet_class)">confdroid_ntp::params</a></span> <span class='object_link'><a href="puppet_classes/confdroid_ntp_3A_3Aparams.html" title="puppet_classes::confdroid_ntp::params (puppet_class)">confdroid_ntp::params</a></span>
</div> </div>

View File

@@ -109,7 +109,11 @@
11 11
12 12
13 13
14</pre> 14
15
16
17
18</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/main/config.pp', line 6</span> <pre class="code"><span class="info file"># File 'manifests/main/config.pp', line 6</span>
@@ -119,9 +123,13 @@ class confdroid_ntp::main::config (
) inherits confdroid_ntp::params { ) inherits confdroid_ntp::params {
include confdroid_ntp::main::service include confdroid_ntp::main::service
# if $ay_manage_nagios == true { if $cy_manage_nagios == true {
# include confdroid_ntp::monitoring::target include confdroid_ntp::monitoring::target
# } }
if $cy_manage_loki == true {
include confdroid_ntp::monitoring::loki
}
}</pre> }</pre>
</td> </td>
</tr> </tr>

View File

@@ -109,7 +109,51 @@
11 11
12 12
13 13
14</pre> 14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/main/dirs.pp', line 6</span> <pre class="code"><span class="info file"># File 'manifests/main/dirs.pp', line 6</span>
@@ -120,8 +164,52 @@ class confdroid_ntp::main::dirs (
require confdroid_ntp::main::install require confdroid_ntp::main::install
# /var/log/chrony # /var/log/chrony
file { &#39;/var/log/chrony&#39;:
ensure =&gt; directory,
owner =&gt; &#39;chrony&#39;,
group =&gt; &#39;chrony&#39;,
mode =&gt; &#39;0750&#39;,
selrange =&gt; s0,
selrole =&gt; object_r,
seltype =&gt; chronyd_var_log_t,
seluser =&gt; system_u,
}
# /var/lib/chrony # /var/lib/chrony
file { &#39;/var/lib/chrony&#39;:
ensure =&gt; directory,
owner =&gt; &#39;chrony&#39;,
group =&gt; &#39;chrony&#39;,
mode =&gt; &#39;0750&#39;,
selrange =&gt; s0,
selrole =&gt; object_r,
seltype =&gt; chronyd_var_lib_t,
seluser =&gt; system_u,
}
# /run/chrony
file { &#39;/run/chrony&#39;:
ensure =&gt; directory,
owner =&gt; &#39;chrony&#39;,
group =&gt; &#39;chrony&#39;,
mode =&gt; &#39;0750&#39;,
selrange =&gt; s0,
selrole =&gt; object_r,
seltype =&gt; chronyd_var_run_t,
seluser =&gt; system_u,
}
# /run/chrony-dhcp
file { &#39;/run/chrony-dhcp&#39;:
ensure =&gt; directory,
owner =&gt; &#39;root&#39;,
group =&gt; &#39;root&#39;,
mode =&gt; &#39;0755&#39;,
selrange =&gt; s0,
selrole =&gt; object_r,
seltype =&gt; chronyd_var_run_t,
seluser =&gt; system_u,
}
}</pre> }</pre>
</td> </td>
</tr> </tr>

View File

@@ -123,7 +123,28 @@
25 25
26 26
27 27
28</pre> 28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/main/files.pp', line 6</span> <pre class="code"><span class="info file"># File 'manifests/main/files.pp', line 6</span>
@@ -148,8 +169,29 @@ class confdroid_ntp::main::files (
} }
# drift file /var/lib/chrony/drift # drift file /var/lib/chrony/drift
file { $cy_drift_file:
ensure =&gt; file,
owner =&gt; &#39;chrony&#39;,
group =&gt; &#39;chrony&#39;,
mode =&gt; &#39;0644&#39;,
selrange =&gt; s0,
selrole =&gt; object_r,
seltype =&gt; chronyd_var_lib_t,
seluser =&gt; system_u,
}
# log rotation # log rotation
file { $cy_logrotate_file:
ensure =&gt; file,
owner =&gt; &#39;root&#39;,
group =&gt; &#39;root&#39;,
mode =&gt; &#39;0644&#39;,
selrange =&gt; s0,
selrole =&gt; object_r,
seltype =&gt; etc_t,
seluser =&gt; system_u,
content =&gt; template($cy_logrotate_erb),
}
}</pre> }</pre>
</td> </td>
</tr> </tr>

View File

@@ -0,0 +1,138 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Puppet Class: confdroid_ntp::monitoring::loki
&mdash; Documentation by YARD 0.9.36
</title>
<link rel="stylesheet" href="../css/style.css" type="text/css" />
<link rel="stylesheet" href="../css/common.css" type="text/css" />
<script type="text/javascript">
pathId = "puppet_classes::confdroid_ntp::monitoring::loki";
relpath = '../';
</script>
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="../puppet_class_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="../_index.html">Index (c)</a> &raquo;
<span class='title'><span class='object_link'>Puppet Classes</span></span>
&raquo;
<span class="title">confdroid_ntp::monitoring::loki</span>
</div>
<div id="search">
<a class="full_list_link" id="puppet_class_list_link"
href="../puppet_class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><h1>Puppet Class: confdroid_ntp::monitoring::loki</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd><span class='object_link'><a href="confdroid_ntp_3A_3Aparams.html" title="puppet_classes::confdroid_ntp::params (puppet_class)">confdroid_ntp::params</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>
manifests/monitoring/loki.pp
</dd>
</dl>
</div>
<h2>Summary</h2>
Class manages loki monitoring for the confdroid_ntp services
<h2>Overview</h2>
<div class="docstring">
<div class="discussion">
<p>confdroid_ntp::monitoring::loki.pp Module name: confdroid_ntp Author: 12ww1160 (12ww1160@confdroid.com)</p>
</div>
</div>
<div class="tags">
</div><div class="method_details_list">
<table class="source_code">
<tr>
<td>
<pre class="lines">
6
7
8
9
10
11
12
13
14</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/monitoring/loki.pp', line 6</span>
class confdroid_ntp::monitoring::loki (
) inherits confdroid_ntp::params {
if $cy_manage_loki == true {
confdroid_alloy::monitoring::log_targets { &quot;confdroid_ntp_${fqdn}&quot;:
targets =&gt; [&#39;/var/log/chrony&#39;],
}
}
}</pre>
</td>
</tr>
</table>
</div>
</div>
<div id="footer">
Generated by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>.
</div>
</div>
</body>
</html>

View File

@@ -104,7 +104,21 @@
6 6
7 7
8 8
9</pre> 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23</pre>
</td> </td>
<td> <td>
<pre class="code"><span class="info file"># File 'manifests/monitoring/target.pp', line 6</span> <pre class="code"><span class="info file"># File 'manifests/monitoring/target.pp', line 6</span>
@@ -112,6 +126,20 @@
class confdroid_ntp::monitoring::target ( class confdroid_ntp::monitoring::target (
) inherits confdroid_ntp::params { ) inherits confdroid_ntp::params {
if $cy_manage_nagios == true {
@@nagios_service { &quot;check_chronyd_${fqdn}&quot;:
check_command =&gt; &quot;check_nrpe!check_chronyd!${cy_procs_allowed}!chronyd&quot;,
use =&gt; &#39;generic-service&#39;,
host_name =&gt; $fqdn,
notification_period =&gt; &#39;24x7&#39;,
service_description =&gt; &quot;${fqdn}_check_chronyd&quot;,
target =&gt; $cy_target_service,
owner =&gt; &#39;nagios&#39;,
group =&gt; &#39;nagios&#39;,
mode =&gt; &#39;0640&#39;,
contacts =&gt; $cy_target_contacts,
}
}
}</pre> }</pre>
</td> </td>
</tr> </tr>

View File

@@ -77,6 +77,8 @@
<span class='object_link'><a href="confdroid_ntp_3A_3Amain_3A_3Aservice.html" title="puppet_classes::confdroid_ntp::main::service (puppet_class)">confdroid_ntp::main::service</a></span><br/> <span class='object_link'><a href="confdroid_ntp_3A_3Amain_3A_3Aservice.html" title="puppet_classes::confdroid_ntp::main::service (puppet_class)">confdroid_ntp::main::service</a></span><br/>
<span class='object_link'><a href="confdroid_ntp_3A_3Amonitoring_3A_3Aloki.html" title="puppet_classes::confdroid_ntp::monitoring::loki (puppet_class)">confdroid_ntp::monitoring::loki</a></span><br/>
<span class='object_link'><a href="confdroid_ntp_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_ntp::monitoring::target (puppet_class)">confdroid_ntp::monitoring::target</a></span><br/> <span class='object_link'><a href="confdroid_ntp_3A_3Amonitoring_3A_3Atarget.html" title="puppet_classes::confdroid_ntp::monitoring::target (puppet_class)">confdroid_ntp::monitoring::target</a></span><br/>
</dd> </dd>
@@ -152,7 +154,7 @@
<span class='type'>(<tt>String</tt>)</span> <span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;ntp.example.com&#39;</tt>)</em> <em class="default">(defaults to: <tt>&#39;ntp.example.local&#39;</tt>)</em>
&mdash; &mdash;
@@ -176,6 +178,204 @@
&mdash; &mdash;
<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>&#39;3&#39;</tt>)</em>
&mdash;
<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>&#39;192.168.1.0/24&#39;</tt>)</em>
&mdash;
<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>&#39;slew&#39;</tt>)</em>
&mdash;
<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>&#39;right/UTC&#39;</tt>)</em>
&mdash;
<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>&#39;measurements statistics tracking&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Log information to record. Valid values are ‘measurements’, ‘statistics’, and ‘tracking’.</p>
</div>
</li>
<li>
<span class='name'>cy_use_lan_server</span>
<span class='type'>(<tt>Boolean</tt>)</span>
<em class="default">(defaults to: <tt>false</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether to use a local LAN server or external pool.</p>
</div>
</li>
<li>
<span class='name'>cy_manage_nagios</span>
<span class='type'>(<tt>Boolean</tt>)</span>
<em class="default">(defaults to: <tt>false</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether to manage Nagios monitoring for the module.</p>
</div>
</li>
<li>
<span class='name'>cy_procs_allowed</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;1:&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Number of allowed processes for the Nagios check.</p>
</div>
</li>
<li>
<span class='name'>cy_target_service</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;/etc/nagios/conf.d/chronyd_service.cfg&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>Path to the Nagios service configuration file.</p>
</div>
</li>
<li>
<span class='name'>cy_target_contacts</span>
<span class='type'>(<tt>Array</tt>)</span>
<em class="default">(defaults to: <tt>[&#39;nagiosadmin&#39;]</tt>)</em>
&mdash;
<div class='inline'>
<p>List of Nagios contacts for notifications. must exist in Nagios contacts configuration!</p>
</div>
</li>
<li>
<span class='name'>cy_manage_loki</span>
<span class='type'>(<tt>Boolean</tt>)</span>
<em class="default">(defaults to: <tt>false</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether to manage Loki logging for the module.</p>
</div> </div>
</li> </li>
@@ -191,21 +391,6 @@
<pre class="lines"> <pre class="lines">
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 28
29 29
30 30
@@ -216,10 +401,46 @@
35 35
36 36
37 37
38</pre> 38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74</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 28</span>
class confdroid_ntp::params ( class confdroid_ntp::params (
@@ -228,18 +449,39 @@ class confdroid_ntp::params (
String $cy_pkg_ensure = &#39;present&#39;, String $cy_pkg_ensure = &#39;present&#39;,
# configuration # configuration
String $cy_server_fqdn = &#39;ntp.example.com&#39;, Boolean $cy_use_lan_server = false,
String $cy_server_fqdn = &#39;ntp.example.local&#39;,
Array $cy_conf_servers = [&#39;0.pool.ntp.org&#39;, &#39;1.pool.ntp.org&#39;, &#39;2.pool.ntp.org&#39;, &#39;3.pool.ntp.org&#39;], Array $cy_conf_servers = [&#39;0.pool.ntp.org&#39;, &#39;1.pool.ntp.org&#39;, &#39;2.pool.ntp.org&#39;, &#39;3.pool.ntp.org&#39;],
String $cy_min_sources = &#39;3&#39;,
String $cy_client_allow = &#39;192.168.1.0/24&#39;,
String $cy_leapsec_mode = &#39;slew&#39;,
String $cy_leapsectz = &#39;right/UTC&#39;,
String $cy_loginfo = &#39;measurements statistics tracking&#39;,
# monitoring
Boolean $cy_manage_nagios = false,
String $cy_procs_allowed = &#39;1:&#39;,
String $cy_target_service = &#39;/etc/nagios/conf.d/chronyd_service.cfg&#39;,
Array $cy_target_contacts = [&#39;nagiosadmin&#39;],
# loki
Boolean $cy_manage_loki = false,
) { ) {
# defaults # facts
$fqdn = $facts[&#39;networking&#39;][&#39;fqdn&#39;] $fqdn = $facts[&#39;networking&#39;][&#39;fqdn&#39;]
$domain = $facts[&#39;networking&#39;][&#39;domain&#39;]
$os_name = $facts[&#39;os&#39;][&#39;name&#39;]
$os_release = $facts[&#39;os&#39;][&#39;release&#39;][&#39;major&#39;]
# dirs # dirs
# files # files
$cy_conf_file = &#39;/etc/chrony.conf&#39; $cy_conf_file = &#39;/etc/chrony.conf&#39;
$cy_conf_erb = &#39;confdroid_ntp/chrony.conf.erb&#39; $cy_conf_erb = &#39;confdroid_ntp/chrony.conf.erb&#39;
$cy_drift_file = &#39;/var/lib/chrony/drift&#39;
$cy_logrotate_file = &#39;/etc/logrotate.d/chrony&#39;
$cy_logrotate_erb = &#39;confdroid_ntp/logrotate.chrony.erb&#39;
# service # service
$cy_service = &#39;chronyd&#39; $cy_service = &#39;chronyd&#39;

View File

@@ -8,7 +8,11 @@ class confdroid_ntp::main::config (
) inherits confdroid_ntp::params { ) inherits confdroid_ntp::params {
include confdroid_ntp::main::service include confdroid_ntp::main::service
# if $ay_manage_nagios == true { if $cy_manage_nagios == true {
# include confdroid_ntp::monitoring::target include confdroid_ntp::monitoring::target
# } }
if $cy_manage_loki == true {
include confdroid_ntp::monitoring::loki
}
} }

View File

@@ -9,6 +9,50 @@ class confdroid_ntp::main::dirs (
require confdroid_ntp::main::install require confdroid_ntp::main::install
# /var/log/chrony # /var/log/chrony
file { '/var/log/chrony':
ensure => directory,
owner => 'chrony',
group => 'chrony',
mode => '0750',
selrange => s0,
selrole => object_r,
seltype => chronyd_var_log_t,
seluser => system_u,
}
# /var/lib/chrony # /var/lib/chrony
file { '/var/lib/chrony':
ensure => directory,
owner => 'chrony',
group => 'chrony',
mode => '0750',
selrange => s0,
selrole => object_r,
seltype => chronyd_var_lib_t,
seluser => system_u,
}
# /run/chrony
file { '/run/chrony':
ensure => directory,
owner => 'chrony',
group => 'chrony',
mode => '0750',
selrange => s0,
selrole => object_r,
seltype => chronyd_var_run_t,
seluser => system_u,
}
# /run/chrony-dhcp
file { '/run/chrony-dhcp':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
selrange => s0,
selrole => object_r,
seltype => chronyd_var_run_t,
seluser => system_u,
}
} }

View File

@@ -23,6 +23,27 @@ class confdroid_ntp::main::files (
} }
# drift file /var/lib/chrony/drift # drift file /var/lib/chrony/drift
file { $cy_drift_file:
ensure => file,
owner => 'chrony',
group => 'chrony',
mode => '0644',
selrange => s0,
selrole => object_r,
seltype => chronyd_var_lib_t,
seluser => system_u,
}
# log rotation # log rotation
file { $cy_logrotate_file:
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
selrange => s0,
selrole => object_r,
seltype => etc_t,
seluser => system_u,
content => template($cy_logrotate_erb),
}
} }

View File

@@ -0,0 +1,14 @@
#### confdroid_ntp::monitoring::loki.pp
# Module name: confdroid_ntp
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class manages loki monitoring for the confdroid_ntp services
###############################################################################
class confdroid_ntp::monitoring::loki (
) inherits confdroid_ntp::params {
if $cy_manage_loki == true {
confdroid_alloy::monitoring::log_targets { "confdroid_ntp_${fqdn}":
targets => ['/var/log/chrony'],
}
}
}

View File

@@ -6,4 +6,18 @@
class confdroid_ntp::monitoring::target ( class confdroid_ntp::monitoring::target (
) inherits confdroid_ntp::params { ) inherits confdroid_ntp::params {
if $cy_manage_nagios == true {
@@nagios_service { "check_chronyd_${fqdn}":
check_command => "check_nrpe!check_chronyd!${cy_procs_allowed}!chronyd",
use => 'generic-service',
host_name => $fqdn,
notification_period => '24x7',
service_description => "${fqdn}_check_chronyd",
target => $cy_target_service,
owner => 'nagios',
group => 'nagios',
mode => '0640',
contacts => $cy_target_contacts,
}
}
} }

View File

@@ -9,6 +9,21 @@
# 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'.
# @param [Boolean] cy_use_lan_server Whether to use a local LAN server or external pool.
# @param [Boolean] cy_manage_nagios Whether to manage Nagios monitoring for the module.
# @param [String] cy_procs_allowed Number of allowed processes for the Nagios check.
# @param [String] cy_target_service Path to the Nagios service configuration file.
# @param [Array] cy_target_contacts List of Nagios contacts for notifications.
# must exist in Nagios contacts configuration!
# @param [Boolean] cy_manage_loki Whether to manage Loki logging for the module.
############################################################################### ###############################################################################
class confdroid_ntp::params ( class confdroid_ntp::params (
@@ -17,18 +32,39 @@ class confdroid_ntp::params (
String $cy_pkg_ensure = 'present', String $cy_pkg_ensure = 'present',
# configuration # configuration
String $cy_server_fqdn = 'ntp.example.com', Boolean $cy_use_lan_server = false,
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',
# monitoring
Boolean $cy_manage_nagios = false,
String $cy_procs_allowed = '1:',
String $cy_target_service = '/etc/nagios/conf.d/chronyd_service.cfg',
Array $cy_target_contacts = ['nagiosadmin'],
# loki
Boolean $cy_manage_loki = false,
) { ) {
# defaults # facts
$fqdn = $facts['networking']['fqdn'] $fqdn = $facts['networking']['fqdn']
$domain = $facts['networking']['domain']
$os_name = $facts['os']['name']
$os_release = $facts['os']['release']['major']
# dirs # dirs
# files # files
$cy_conf_file = '/etc/chrony.conf' $cy_conf_file = '/etc/chrony.conf'
$cy_conf_erb = 'confdroid_ntp/chrony.conf.erb' $cy_conf_erb = 'confdroid_ntp/chrony.conf.erb'
$cy_drift_file = '/var/lib/chrony/drift'
$cy_logrotate_file = '/etc/logrotate.d/chrony'
$cy_logrotate_erb = 'confdroid_ntp/logrotate.chrony.erb'
# service # service
$cy_service = 'chronyd' $cy_service = 'chronyd'

View File

@@ -6,13 +6,114 @@
<% if @fqdn == @cy_server_fqdn -%> <% if @fqdn == @cy_server_fqdn -%>
# This is a time server configuration file # This is a time server configuration file
# Use public servers from the pool.ntp.org project.
<% @cy_conf_servers.each do |this_server| -%> <% @cy_conf_servers.each do |this_server| -%>
pool <%= this_server %> iburst pool <%= this_server %> iburst
<% end -%> <% end -%>
# Use NTP servers from DHCP.
sourcedir /run/chrony-dhcp
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
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 %>
<% if @fqdn != @cy_server_fqdn -%> <% if @fqdn != @cy_server_fqdn -%>
# This is a time client configuration file # This is a time client configuration file
<% end -%> <% if @cy_use_lan_server -%>
server <%= @cy_server_fqdn %> iburst
<% else -%>
# Use public servers from the pool.ntp.org project.
<% @cy_conf_servers.each do |this_server| -%>
server <%= this_server %> iburst
<% end end -%>
<% end -%> # Use NTP servers from DHCP.
sourcedir /run/chrony-dhcp
# Record the rate at which the system clock gains/losses time.
driftfile /var/lib/chrony/drift
# Allow the system clock to be stepped in the first three updates
# if its offset is larger than 1 second.
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 %>

View File

@@ -0,0 +1,9 @@
# file created by Puppet, manual changes will be overwritten
/var/log/chrony/*.log {
missingok
nocreate
sharedscripts
postrotate
/usr/bin/chronyc cyclelogs > /dev/null 2>&1 || true
endscript
}