Merge branch 'jenkins' into 'master'

Jenkins

See merge request !14
This commit is contained in:
12ww1160
2017-07-21 16:27:16 +02:00
28 changed files with 470 additions and 59 deletions

View File

@@ -8,6 +8,16 @@ Changelog of Git Changelog.
<h2> No issue </h2>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/60407116a503868">60407116a503868</a> Jenkins Server <i>2017-07-21 13:47:34</i>
<p>
<h3>recommit for updates in build 27</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/409ec084543f0d8">409ec084543f0d8</a> Arne Teuke <i>2017-07-21 13:47:12</i>
<p>
<h3>added control for forward.conf</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/1fc9ffeacdebd20">1fc9ffeacdebd20</a> Jenkins Server <i>2017-07-21 13:43:26</i>
<p>
<h3>recommit for updates in build 26</h3>

View File

@@ -1,6 +1,6 @@
|Repo Name| version | Build Status|
|---|---|---|---|
|`cd_nagios`| 0.0.0.7 | [![Build Status](https://jenkins.confdroid.com/buildStatus/icon?job=cd_nagios)](https://jenkins.confdroid.com/job/cd_nagios/)|
|`cd_nagios`| 0.0.0.8 | [![Build Status](https://jenkins.confdroid.com/buildStatus/icon?job=cd_nagios)](https://jenkins.confdroid.com/job/cd_nagios/)|
### Synopsis
Nagios is a powerful open source software solution for monitoring your IT environments.
@@ -62,6 +62,7 @@ All dependencies must be included in the catalogue.
* [cd_apache](https://gitlab.puppetsoft.com/12WW1160/cd_apache) for installing httpd
* [cd_firewall](https://gitlab.puppetsoft.com/12WW1160/cd_firewall) or [puppetlabs firewall](https://github.com/puppetlabs/puppetlabs-firewall) (optional)
* [cd_selinux](https://gitlab.puppetsoft.com/12WW1160/cd_selinux) for selinux policy adjustments
* [cd_certbot](https://gitlab.puppetsoft.com/12WW1160/cd_certbot) to auto-manage TLS certificates (optional)
### Deployment

View File

@@ -31,6 +31,8 @@
| |-- puppet_defined_type_list.html
| `-- top-level-namespace.html
|-- manifests
| |-- certbot
| | `-- config.pp
| |-- client
| | `-- target.pp
| |-- firewall
@@ -50,6 +52,9 @@
| |-- init.pp
| `-- params.pp
|-- templates
| |-- certbot
| | |-- get_cert.erb
| | `-- unless_get_cert.erb
| |-- httpd
| | |-- forward_conf.erb
| | |-- nagios_conf.erb
@@ -70,4 +75,4 @@
|-- README.md
`-- REPOSTRUCTURE.md
16 directories, 54 files
18 directories, 57 files

View File

@@ -73,6 +73,11 @@
</li>
<li>
<span class='object_link'><a href="puppet_classes/cd_nagios_3A_3Acertbot_3A_3Aconfig.html" title="puppet_classes::cd_nagios::certbot::config (puppet_class)">cd_nagios::certbot::config</a></span>
</li>
<li>
<span class='object_link'><a href="puppet_classes/cd_nagios_3A_3Aclient_3A_3Atarget.html" title="puppet_classes::cd_nagios::client::target (puppet_class)">cd_nagios::client::target</a></span>
@@ -181,7 +186,7 @@
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:26 2017 by
Generated on Fri Jul 21 16:34:18 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -61,7 +61,7 @@
<p>|Repo Name| version | Build
Status|
|---|---|---|---|
|<code>cd_nagios</code>| 0.0.0.7 | <a
|<code>cd_nagios</code>| 0.0.0.8 | <a
href="https://jenkins.confdroid.com/buildStatus/icon?job=cd_nagios">{Build
Status</a>/]|</p>
@@ -174,6 +174,9 @@ firewall</a> (optional)</p>
</li><li>
<p><a href="https://gitlab.puppetsoft.com/12WW1160/cd_selinux">cd_selinux</a>
for selinux policy adjustments</p>
</li><li>
<p><a href="https://gitlab.puppetsoft.com/12WW1160/cd_certbot">cd_certbot</a>
to auto-manage TLS certificates (optional)</p>
</li></ul>
<h3 id="label-Deployment">Deployment</h3>
@@ -299,7 +302,7 @@ environments.</p>
</div></div>
<div id="footer">
Generated on Fri Jul 21 15:47:28 2017 by
Generated on Fri Jul 21 16:34:19 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -61,7 +61,7 @@
<p>|Repo Name| version | Build
Status|
|---|---|---|---|
|<code>cd_nagios</code>| 0.0.0.7 | <a
|<code>cd_nagios</code>| 0.0.0.8 | <a
href="https://jenkins.confdroid.com/buildStatus/icon?job=cd_nagios">{Build
Status</a>/]|</p>
@@ -174,6 +174,9 @@ firewall</a> (optional)</p>
</li><li>
<p><a href="https://gitlab.puppetsoft.com/12WW1160/cd_selinux">cd_selinux</a>
for selinux policy adjustments</p>
</li><li>
<p><a href="https://gitlab.puppetsoft.com/12WW1160/cd_certbot">cd_certbot</a>
to auto-manage TLS certificates (optional)</p>
</li></ul>
<h3 id="label-Deployment">Deployment</h3>
@@ -299,7 +302,7 @@ environments.</p>
</div></div>
<div id="footer">
Generated on Fri Jul 21 15:47:27 2017 by
Generated on Fri Jul 21 16:34:18 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -47,77 +47,84 @@
</li>
<li id="object_puppet_classes::cd_nagios::client::target" class="even">
<li id="object_puppet_classes::cd_nagios::certbot::config" class="even">
<div class="item">
<span class='object_link'><a href="puppet_classes/cd_nagios_3A_3Acertbot_3A_3Aconfig.html" title="puppet_classes::cd_nagios::certbot::config (puppet_class)">cd_nagios::certbot::config</a></span>
</div>
</li>
<li id="object_puppet_classes::cd_nagios::client::target" class="odd">
<div class="item">
<span class='object_link'><a href="puppet_classes/cd_nagios_3A_3Aclient_3A_3Atarget.html" title="puppet_classes::cd_nagios::client::target (puppet_class)">cd_nagios::client::target</a></span>
</div>
</li>
<li id="object_puppet_classes::cd_nagios::firewall::iptables" class="odd">
<li id="object_puppet_classes::cd_nagios::firewall::iptables" class="even">
<div class="item">
<span class='object_link'><a href="puppet_classes/cd_nagios_3A_3Afirewall_3A_3Aiptables.html" title="puppet_classes::cd_nagios::firewall::iptables (puppet_class)">cd_nagios::firewall::iptables</a></span>
</div>
</li>
<li id="object_puppet_classes::cd_nagios::main::config" class="even">
<li id="object_puppet_classes::cd_nagios::main::config" class="odd">
<div class="item">
<span class='object_link'><a href="puppet_classes/cd_nagios_3A_3Amain_3A_3Aconfig.html" title="puppet_classes::cd_nagios::main::config (puppet_class)">cd_nagios::main::config</a></span>
</div>
</li>
<li id="object_puppet_classes::cd_nagios::main::dirs" class="odd">
<li id="object_puppet_classes::cd_nagios::main::dirs" class="even">
<div class="item">
<span class='object_link'><a href="puppet_classes/cd_nagios_3A_3Amain_3A_3Adirs.html" title="puppet_classes::cd_nagios::main::dirs (puppet_class)">cd_nagios::main::dirs</a></span>
</div>
</li>
<li id="object_puppet_classes::cd_nagios::main::install" class="even">
<li id="object_puppet_classes::cd_nagios::main::install" class="odd">
<div class="item">
<span class='object_link'><a href="puppet_classes/cd_nagios_3A_3Amain_3A_3Ainstall.html" title="puppet_classes::cd_nagios::main::install (puppet_class)">cd_nagios::main::install</a></span>
</div>
</li>
<li id="object_puppet_classes::cd_nagios::main::user" class="odd">
<li id="object_puppet_classes::cd_nagios::main::user" class="even">
<div class="item">
<span class='object_link'><a href="puppet_classes/cd_nagios_3A_3Amain_3A_3Auser.html" title="puppet_classes::cd_nagios::main::user (puppet_class)">cd_nagios::main::user</a></span>
</div>
</li>
<li id="object_puppet_classes::cd_nagios::params" class="even">
<li id="object_puppet_classes::cd_nagios::params" class="odd">
<div class="item">
<span class='object_link'><a href="puppet_classes/cd_nagios_3A_3Aparams.html" title="puppet_classes::cd_nagios::params (puppet_class)">cd_nagios::params</a></span>
</div>
</li>
<li id="object_puppet_classes::cd_nagios::selinux::config" class="odd">
<li id="object_puppet_classes::cd_nagios::selinux::config" class="even">
<div class="item">
<span class='object_link'><a href="puppet_classes/cd_nagios_3A_3Aselinux_3A_3Aconfig.html" title="puppet_classes::cd_nagios::selinux::config (puppet_class)">cd_nagios::selinux::config</a></span>
</div>
</li>
<li id="object_puppet_classes::cd_nagios::server::access_rules" class="even">
<li id="object_puppet_classes::cd_nagios::server::access_rules" class="odd">
<div class="item">
<span class='object_link'><a href="puppet_classes/cd_nagios_3A_3Aserver_3A_3Aaccess_rules.html" title="puppet_classes::cd_nagios::server::access_rules (puppet_class)">cd_nagios::server::access_rules</a></span>
</div>
</li>
<li id="object_puppet_classes::cd_nagios::server::files" class="odd">
<li id="object_puppet_classes::cd_nagios::server::files" class="even">
<div class="item">
<span class='object_link'><a href="puppet_classes/cd_nagios_3A_3Aserver_3A_3Afiles.html" title="puppet_classes::cd_nagios::server::files (puppet_class)">cd_nagios::server::files</a></span>
</div>
</li>
<li id="object_puppet_classes::cd_nagios::server::service" class="even">
<li id="object_puppet_classes::cd_nagios::server::service" class="odd">
<div class="item">
<span class='object_link'><a href="puppet_classes/cd_nagios_3A_3Aserver_3A_3Aservice.html" title="puppet_classes::cd_nagios::server::service (puppet_class)">cd_nagios::server::service</a></span>
</div>

View File

@@ -139,7 +139,7 @@ class cd_nagios {
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:28 2017 by
Generated on Fri Jul 21 16:34:19 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -0,0 +1,218 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Puppet Class: cd_nagios::certbot::config
&mdash; Documentation by YARD 0.9.9
</title>
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
<script type="text/javascript" charset="utf-8">
pathId = "puppet_classes::cd_nagios::certbot::config";
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">cd_nagios::certbot::config</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: cd_nagios::certbot::config</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd><span class='object_link'><a href="cd_nagios_3A_3Aparams.html" title="puppet_classes::cd_nagios::params (puppet_class)">cd_nagios::params</a></span></dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>
manifests/certbot/config.pp
</dd>
</dl>
</div>
<h2>Summary</h2>
Class manages all configuration files required for cd_nagios.
<h2>Overview</h2>
<div class="docstring">
<div class="discussion">
<p>cd_nagios::certbot::config.pp
Module name: cd_nagios
Author: Arne Teuke
(arne_teuke@ConfDroid.com)</p>
<h1 id="label-License%3A">License:</h1>
<p>This file is part of cd_nagios.</p>
<p>cd_nagios is used for providing automatic configuration of Nagios
Copyright (C) 2016 ConfDroid (copyright@ConfDroid.com)
This program is
free software: you can redistribute it and/or modify
it under the terms of
the GNU General Public License as published by
the Free Software
Foundation, either version 3 of the License, or
(at your option) any later
version.</p>
<p>This program is distributed in the hope that it will be useful,
but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License
for more details.</p>
<p>You should have received a copy of the GNU General Public License
along
with this program. If not, see <a
href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.</p>
</div>
</div>
<div class="tags">
</div><div class="method_details_list">
<table class="source_code">
<tr>
<td>
<pre class="lines">
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</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/certbot/config.pp', line 23</span>
class cd_nagios::certbot::config (
) inherits cd_nagios::params {
if $::fqdn == $ng_nagios_server {
if $ng_enable_certbot == true {
require cd_certbot
# create cert
exec { &#39;create_cert&#39;:
command =&gt; template(&#39;cd_nagios/certbot/get_cert.erb&#39;),
cwd =&gt; &#39;/tmp&#39;,
path =&gt; [&#39;/bin&#39;,&#39;/usr/bin&#39;],
provider =&gt; &#39;shell&#39;,
unless =&gt; template(&#39;cd_nagios/certbot/unless_get_cert.erb&#39;),
notify =&gt; Service[&#39;httpd&#39;],
creates =&gt; &#39;/etc/httpd/conf.d/.cert_created&#39;,
}
# renew certs
exec { &#39;renew_cert&#39;:
command =&gt; &#39;certbot renew&#39;,
cwd =&gt; &#39;/tmp&#39;,
path =&gt; [&#39;/bin&#39;,&#39;/usr/bin&#39;,&#39;/opt/&#39;],
provider =&gt; &#39;shell&#39;,
notify =&gt; Service[&#39;httpd&#39;],
unless =&gt; template(&#39;cd_nagios/certbot/unless_renew_cert.erb&#39;),
}
}
}
}</pre>
</td>
</tr>
</table>
</div>
</div>
<div id="footer">
Generated on Fri Jul 21 16:34:21 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>
</div>
</body>
</html>

View File

@@ -368,7 +368,7 @@ class cd_nagios::client::target (
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:30 2017 by
Generated on Fri Jul 21 16:34:21 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -207,7 +207,7 @@ class cd_nagios::firewall::iptables (
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:30 2017 by
Generated on Fri Jul 21 16:34:21 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -187,7 +187,7 @@ class cd_nagios::main::config (
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:30 2017 by
Generated on Fri Jul 21 16:34:21 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -468,7 +468,7 @@ class cd_nagios::main::dirs (
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:30 2017 by
Generated on Fri Jul 21 16:34:21 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -235,7 +235,7 @@ class cd_nagios::main::install (
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:30 2017 by
Generated on Fri Jul 21 16:34:21 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -200,7 +200,7 @@ class cd_nagios::main::user (
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:30 2017 by
Generated on Fri Jul 21 16:34:21 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -79,6 +79,8 @@
<span class='object_link'><a href="cd_nagios_3A_3Aclient_3A_3Atarget.html" title="puppet_classes::cd_nagios::client::target (puppet_class)">cd_nagios::client::target</a></span><br/>
<span class='object_link'><a href="cd_nagios_3A_3Acertbot_3A_3Aconfig.html" title="puppet_classes::cd_nagios::certbot::config (puppet_class)">cd_nagios::certbot::config</a></span><br/>
<span class='object_link'><a href="cd_nagios_3A_3Aselinux_3A_3Aconfig.html" title="puppet_classes::cd_nagios::selinux::config (puppet_class)">cd_nagios::selinux::config</a></span><br/>
<span class='object_link'><a href="cd_nagios_3A_3Aserver_3A_3Aservice.html" title="puppet_classes::cd_nagios::server::service (puppet_class)">cd_nagios::server::service</a></span><br/>
@@ -1826,7 +1828,7 @@ enabled.</p>
should be
allowed/required. Requires format
&#39;host1.example.com
host2.example.com&#39;</p>
host2.example.com&#39;. If you want no restriction, chose &#39;all&#39;.</p>
</div>
</li>
@@ -1846,10 +1848,14 @@ host2.example.com&#39;</p>
<div class='inline'>
<p>string of &lt;b&gt;_&lt;em&gt;Ip addresses __** for hosts which
should be
allowed/reqired. Requires format &#39;ipaddress ip address range&#39;Ip
addresses _&lt;/em&gt;&lt;/b&gt; for hosts which
should be allowed/reqired.
Requires format &#39;ipaddress ip address range&#39;</p>
allowed/reqired. Requires format &#39;ipaddress ip address range&#39;.
If
you want no restriction, choose &#39;0.0.0.0/0&#39;Ip addresses
_&lt;/em&gt;&lt;/b&gt; for hosts which
should be allowed/reqired. Requires
format &#39;ipaddress ip address range&#39;.
If you want no restriction,
choose &#39;0.0.0.0/0&#39;</p>
</div>
</li>
@@ -1875,6 +1881,64 @@ the nagios http check on the nagios server
</li>
<li>
<span class='name'>ng_enable_certbot</span>
<span class='type'>(<tt>boolean</tt>)</span>
<em class="default">(defaults to: <tt>true</tt>)</em>
&mdash;
<div class='inline'>
<p>Whether to use certbot for automated TLS
certificate management</p>
</div>
</li>
<li>
<span class='name'>ng_certbot_cert_path</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;/var/www/html&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>the path for certbot to place
challenges for teh certification process.</p>
</div>
</li>
<li>
<span class='name'>ng_mail_user</span>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&quot;admin@${::domain}&quot;</tt>)</em>
&mdash;
<div class='inline'>
<p>email address to receive administrative mail.
used for nagios itself as
well as for certbot.</p>
</div>
</li>
</ul>
@@ -1892,13 +1956,6 @@ the nagios http check on the nagios server
<pre class="lines">
206
207
208
209
210
211
212
213
214
215
@@ -2055,10 +2112,22 @@ the nagios http check on the nagios server
366
367
368
369</pre>
369
370
371
372
373
374
375
376
377
378
379
380
381</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 206</span>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 213</span>
class cd_nagios::params (
@@ -2066,6 +2135,7 @@ $pkg_ensure = &#39;latest&#39;,
$ng_nagios_server = &quot;nagios.${::domain}&quot;,
$ng_nagios_ext_ip = undef,
$ng_mail_user = &quot;admin@${::domain}&quot;,
$ng_include_nrpe = true,
@@ -2171,6 +2241,10 @@ $ng_required_hosts = &#39;&#39;,
$ng_required_ips = &#39;127.0.0.0/8&#39;,
$ng_disable_welcome = true,
# certbot
$ng_enable_certbot = true,
$ng_certbot_cert_path = &#39;/var/www/html&#39;,
) {
# installation section
@@ -2231,7 +2305,7 @@ $ng_forward_conf_erb = &#39;cd_nagios/httpd/forward_conf.erb&#39;
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:29 2017 by
Generated on Fri Jul 21 16:34:20 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -249,7 +249,7 @@ class cd_nagios::selinux::config (
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:30 2017 by
Generated on Fri Jul 21 16:34:21 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -195,7 +195,7 @@ class cd_nagios::server::access_rules (
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:31 2017 by
Generated on Fri Jul 21 16:34:21 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -300,7 +300,7 @@ class cd_nagios::server::files (
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:30 2017 by
Generated on Fri Jul 21 16:34:21 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -174,7 +174,7 @@ class cd_nagios::server::service (
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:30 2017 by
Generated on Fri Jul 21 16:34:21 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -220,7 +220,7 @@ $ng_service = $::cd_nagios::params::ng_service
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:31 2017 by
Generated on Fri Jul 21 16:34:22 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -90,7 +90,7 @@
</div>
<div id="footer">
Generated on Fri Jul 21 15:47:28 2017 by
Generated on Fri Jul 21 16:34:19 2017 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.9 (ruby-2.0.0).
</div>

View File

@@ -0,0 +1,56 @@
## cd_nagios::certbot::config.pp
# Module name: cd_nagios
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
# # License:
# This file is part of cd_nagios.
#
# cd_nagios is used for providing automatic configuration of Nagios
# Copyright (C) 2016 ConfDroid (copyright@ConfDroid.com)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# @summary Class manages all configuration files required for cd_nagios.
##############################################################################
class cd_nagios::certbot::config (
) inherits cd_nagios::params {
if $::fqdn == $ng_nagios_server {
if $ng_enable_certbot == true {
require cd_certbot
# create cert
exec { 'create_cert':
command => template('cd_nagios/certbot/get_cert.erb'),
cwd => '/tmp',
path => ['/bin','/usr/bin'],
provider => 'shell',
unless => template('cd_nagios/certbot/unless_get_cert.erb'),
notify => Service['httpd'],
creates => '/etc/httpd/conf.d/.cert_created',
}
# renew certs
exec { 'renew_cert':
command => 'certbot renew',
cwd => '/tmp',
path => ['/bin','/usr/bin','/opt/'],
provider => 'shell',
notify => Service['httpd'],
unless => template('cd_nagios/certbot/unless_renew_cert.erb'),
}
}
}
}

View File

@@ -196,12 +196,19 @@
# policies. only effective if selinux is enabled.
# @param [string] ng_required_hosts String of **__FQDNs__** for hosts which
# should be allowed/required. Requires format
# 'host1.example.com host2.example.com'
# 'host1.example.com host2.example.com'. If you want no restriction, chose 'all'.
# @param [string] ng_required_ips string of **__Ip addresses __** for hosts which
# should be allowed/reqired. Requires format 'ipaddress ip address range'
# should be allowed/reqired. Requires format 'ipaddress ip address range'.
# If you want no restriction, choose '0.0.0.0/0'
# @param [boolean] ng_disable_welcome Whether the regular welcome screen should
# be disabled. this is required for the nagios http check on the nagios server
# to be successful.
# @param [boolean] ng_enable_certbot Whether to use certbot for automated TLS
# certificate management
# @param [string] ng_certbot_cert_path the path for certbot to place
# challenges for teh certification process.
# @param [string] ng_mail_user email address to receive administrative mail.
# used for nagios itself as well as for certbot.
###############################################################################
class cd_nagios::params (
@@ -209,6 +216,7 @@ $pkg_ensure = 'latest',
$ng_nagios_server = "nagios.${::domain}",
$ng_nagios_ext_ip = undef,
$ng_mail_user = "admin@${::domain}",
$ng_include_nrpe = true,
@@ -314,6 +322,10 @@ $ng_required_hosts = '',
$ng_required_ips = '127.0.0.0/8',
$ng_disable_welcome = true,
# certbot
$ng_enable_certbot = true,
$ng_certbot_cert_path = '/var/www/html',
) {
# installation section

View File

@@ -0,0 +1,2 @@
certbot certonly -t -n --agree-tos --webroot -w <%= @ng_certbot_cert_path %>/ -d <%= @ng_nagios_server %> --email <%= @ng_mail_user %>
touch /etc/httpd/conf.d/.cert_created

View File

@@ -0,0 +1,4 @@
#!/bin/bash
<% if @ng_enable_certbot == true %>
test -d /etc/letsencrypt/archive/<%= @ng_nagios_server %>
<% end %>

View File

@@ -1,9 +1,14 @@
<VirtualHost *:80>
<VirtualHost *:<%= @ng_http_port %>>
ServerAdmin root@localhost
DocumentRoot /var/www/html
ServerName www.<%= @ng_nagios_server %>
ServerAlias <%= @ng_nagios_server %>
<% if @ng_use_https == true -%>
Redirect permanent / https://<%= @ng_nagios_server %>/nagios
<% end -%>
<% if @ng_use_https != true -%>
Redirect permanent / http://<%= @ng_nagios_server %>/nagios
<% end -%>
<Directory />
AllowOverride All
</Directory>

View File

@@ -33,11 +33,12 @@ ScriptAlias /nagios/cgi-bin/ "/usr/lib64/nagios/cgi-bin/"
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
<% unless @ng_required_hosts.empty? -%>
Allow from <%= @ng_required_hosts %>
<% end -%>
<% unless @ng_required_ips.empty? -%>
Alloow from <%= @ng_required_ips %>
<% end -%>
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/passwd
@@ -48,7 +49,11 @@ ScriptAlias /nagios/cgi-bin/ "/usr/lib64/nagios/cgi-bin/"
Alias /nagios "/usr/share/nagios/html"
<Directory "/usr/share/nagios/html">
<% if @ng_use_https == true -%>
SSLRequireSSL
<% else -%>
# SSLRequireSSL
<% end -%>
Options None
AllowOverride None
<IfVersion >= 2.3>
@@ -68,11 +73,12 @@ Alias /nagios "/usr/share/nagios/html"
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
<% unless @ng_required_hosts.empty? -%>
Allow from <%= @ng_required_hosts %>
<% end -%>
<% unless @ng_required_ips.empty? -%>
Alloow from <%= @ng_required_ips %>
<% end -%>
AuthName "Nagios Access"
AuthType Basic
AuthUserFile /etc/nagios/passwd