Merge branch 'jenkins' into 'master'

Jenkins

See merge request !26
This commit is contained in:
12ww1160
2017-07-23 11:21:55 +02:00
24 changed files with 85 additions and 143 deletions

View File

@@ -8,6 +8,21 @@ Changelog of Git Changelog.
<h2> No issue </h2>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/500c46fa1cae78d">500c46fa1cae78d</a> Jenkins Server <i>2017-07-22 11:38:55</i>
<p>
<h3>recommit for updates in build 46</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/a38ace2f06f6f22">a38ace2f06f6f22</a> Arne Teuke <i>2017-07-22 11:38:36</i>
<p>
<h3>reversing steps to create cert</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/d5a5afcfc3c501a">d5a5afcfc3c501a</a> Arne Teuke <i>2017-07-22 11:23:28</i>
<p>
<h3>reversing steps to create cert</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/92e809e1c65f745">92e809e1c65f745</a> Jenkins Server <i>2017-07-21 16:38:00</i>
<p>
<h3>recommit for updates in build 44</h3>

View File

@@ -9,6 +9,7 @@
| | |-- full_list.js
| | `-- jquery.js
| |-- puppet_classes
| | |-- cd_nagios_3A_3Acertbot_3A_3Acerts.html
| | |-- cd_nagios_3A_3Acertbot_3A_3Aconfig.html
| | |-- cd_nagios_3A_3Aclient_3A_3Atarget.html
| | |-- cd_nagios_3A_3Afirewall_3A_3Aiptables.html
@@ -78,4 +79,4 @@
|-- README.md
`-- REPOSTRUCTURE.md
18 directories, 60 files
18 directories, 61 files

View File

@@ -186,7 +186,7 @@
</div>
<div id="footer">
Generated on Sat Jul 22 13:38:49 2017 by
Generated on Sun Jul 23 11:29:44 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

@@ -304,7 +304,7 @@ environments.</p>
</div></div>
<div id="footer">
Generated on Sat Jul 22 13:38:50 2017 by
Generated on Sun Jul 23 11:29:45 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

@@ -304,7 +304,7 @@ environments.</p>
</div></div>
<div id="footer">
Generated on Sat Jul 22 13:38:50 2017 by
Generated on Sun Jul 23 11:29:44 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

@@ -139,7 +139,7 @@ class cd_nagios {
</div>
<div id="footer">
Generated on Sat Jul 22 13:38:50 2017 by
Generated on Sun Jul 23 11:29:45 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

@@ -169,41 +169,7 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.</p>
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97</pre>
63</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/certbot/certs.pp', line 23</span>
@@ -219,33 +185,6 @@ class cd_nagios::certbot::certs (
require cd_certbot
require cd_apache
# ensure there is no forward vhost file
exec { &#39;remove_forward_vhost&#39;:
command =&gt; &quot;rm -Rf ${ng_forward_conf}&quot;,
creates =&gt; &#39;/etc/httpd/conf.d/.cert_created&#39;,
}
exec { &#39;remove_nagios_conf&#39;:
command =&gt; &quot;rm -Rf ${ng_nagios_conf}&quot;,
creates =&gt; &#39;/etc/httpd/conf.d/.cert_created&#39;,
require =&gt; Exec[&#39;remove_forward_vhost&#39;],
}
exec { &#39;remove_index_html&#39;:
command =&gt; &quot;rm -Rf ${ng_index_html_file}&quot;,
creates =&gt; &#39;/etc/httpd/conf.d/.cert_created&#39;,
require =&gt; Exec[&#39;remove_nagios_conf&#39;],
notify =&gt; Service[$ae_service],
}
exec { &#39;disable_selinux_temporarily&#39;:
command =&gt; &#39;setenforce 0&#39;,
path =&gt; [&#39;/usr/sbin&#39;],
creates =&gt; &#39;/etc/httpd/conf.d/.cert_created&#39;,
require =&gt; Exec[&#39;remove_index_html&#39;],
}
# create cert
exec { &#39;create_cert&#39;:
@@ -255,14 +194,7 @@ class cd_nagios::certbot::certs (
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;,
}
exec { &#39;enable_selinux&#39;:
command =&gt; &#39;setenforce 1&#39;,
path =&gt; [&#39;/usr/sbin&#39;],
creates =&gt; &#39;/etc/httpd/conf.d/.cert_created&#39;,
require =&gt; Exec[&#39;create_cert&#39;],
creates =&gt; $ng_certbot_cert,
}
# renew certs
@@ -290,7 +222,7 @@ class cd_nagios::certbot::certs (
</div>
<div id="footer">
Generated on Sat Jul 22 13:38:52 2017 by
Generated on Sun Jul 23 11:29:47 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

@@ -368,7 +368,7 @@ class cd_nagios::client::target (
</div>
<div id="footer">
Generated on Sat Jul 22 13:38:52 2017 by
Generated on Sun Jul 23 11:29:47 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 Sat Jul 22 13:38:52 2017 by
Generated on Sun Jul 23 11:29:47 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

@@ -170,13 +170,13 @@ class cd_nagios::main::config (
if $::fqdn == $ng_nagios_server {
# include cd_nagios::server::service
# if $ng_include_fw == true {
# include cd_nagios::firewall::iptables
# }
if $ng_include_fw == true {
include cd_nagios::firewall::iptables
}
# if $ng_use_selinux_tools == true {
# include cd_nagios::selinux::config
# }
if $ng_use_selinux_tools == true {
include cd_nagios::selinux::config
}
if $ng_enable_certbot == true {
require cd_nagios::certbot::certs
@@ -195,7 +195,7 @@ class cd_nagios::main::config (
</div>
<div id="footer">
Generated on Sat Jul 22 13:38:52 2017 by
Generated on Sun Jul 23 11:29:47 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 Sat Jul 22 13:38:51 2017 by
Generated on Sun Jul 23 11:29:46 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 Sat Jul 22 13:38:52 2017 by
Generated on Sun Jul 23 11:29:47 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 Sat Jul 22 13:38:52 2017 by
Generated on Sun Jul 23 11:29:47 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

@@ -1887,8 +1887,6 @@ certificate management</p>
<span class='type'>(<tt>string</tt>)</span>
<em class="default">(defaults to: <tt>&#39;/var/www/html&#39;</tt>)</em>
&mdash;
<div class='inline'>
@@ -1962,6 +1960,19 @@ required for certbot and used in the web templates.</p>
</li>
<li>
<span class='name'>ng_certbot_webroot</span>
<span class='type'>(<tt>Any</tt>)</span>
<em class="default">(defaults to: <tt>&#39;/var/www/html&#39;</tt>)</em>
</li>
</ul>
@@ -2152,7 +2163,13 @@ required for certbot and used in the web templates.</p>
386
387
388
389</pre>
389
390
391
392
393
394
395</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 216</span>
@@ -2271,7 +2288,7 @@ $ng_enable_index = true,
# certbot
$ng_enable_certbot = true,
$ng_certbot_cert_path = &#39;/var/www/html&#39;,
$ng_certbot_webroot = &#39;/var/www/html&#39;,
$ng_webserver_name = &quot;nagios.${::domain}&quot;,
) {
@@ -2326,6 +2343,12 @@ $ng_unless_renew_erb = &#39;cd_nagios/certbot/unless_renew_cert.erb&#39;
$ng_index_html_file = &#39;/var/www/html/index.html&#39;
$ng_index_html_erb = &#39;cd_nagios/httpd/index_html.erb&#39;
# certbot
$ng_certbot_main_dir = &#39;/etc/letsencrypt&#39;
$ng_certbot_archive = &quot;${ng_certbot_main_dir}/archive&quot;
$ng_certbot_cert = &quot;${ng_certbot_archive}/${ng_webserver_name}/cert1.pem&quot;
# includes must be last
include cd_nagios::main::config
@@ -2338,7 +2361,7 @@ $ng_index_html_erb = &#39;cd_nagios/httpd/index_html.erb&#39;
</div>
<div id="footer">
Generated on Sat Jul 22 13:38:51 2017 by
Generated on Sun Jul 23 11:29:46 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 Sat Jul 22 13:38:52 2017 by
Generated on Sun Jul 23 11:29:47 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 Sat Jul 22 13:38:52 2017 by
Generated on Sun Jul 23 11:29:47 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

@@ -344,7 +344,7 @@ class cd_nagios::server::files (
</div>
<div id="footer">
Generated on Sat Jul 22 13:38:52 2017 by
Generated on Sun Jul 23 11:29:47 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 Sat Jul 22 13:38:52 2017 by
Generated on Sun Jul 23 11:29:47 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 Sat Jul 22 13:38:53 2017 by
Generated on Sun Jul 23 11:29:48 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 Sat Jul 22 13:38:50 2017 by
Generated on Sun Jul 23 11:29:45 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

@@ -31,33 +31,6 @@ class cd_nagios::certbot::certs (
require cd_certbot
require cd_apache
# ensure there is no forward vhost file
exec { 'remove_forward_vhost':
command => "rm -Rf ${ng_forward_conf}",
creates => '/etc/httpd/conf.d/.cert_created',
}
exec { 'remove_nagios_conf':
command => "rm -Rf ${ng_nagios_conf}",
creates => '/etc/httpd/conf.d/.cert_created',
require => Exec['remove_forward_vhost'],
}
exec { 'remove_index_html':
command => "rm -Rf ${ng_index_html_file}",
creates => '/etc/httpd/conf.d/.cert_created',
require => Exec['remove_nagios_conf'],
notify => Service[$ae_service],
}
exec { 'disable_selinux_temporarily':
command => 'setenforce 0',
path => ['/usr/sbin'],
creates => '/etc/httpd/conf.d/.cert_created',
require => Exec['remove_index_html'],
}
# create cert
exec { 'create_cert':
@@ -67,14 +40,7 @@ class cd_nagios::certbot::certs (
provider => 'shell',
unless => template('cd_nagios/certbot/unless_get_cert.erb'),
notify => Service['httpd'],
creates => '/etc/httpd/conf.d/.cert_created',
}
exec { 'enable_selinux':
command => 'setenforce 1',
path => ['/usr/sbin'],
creates => '/etc/httpd/conf.d/.cert_created',
require => Exec['create_cert'],
creates => $ng_certbot_cert,
}
# renew certs

View File

@@ -30,13 +30,13 @@ class cd_nagios::main::config (
if $::fqdn == $ng_nagios_server {
# include cd_nagios::server::service
# if $ng_include_fw == true {
# include cd_nagios::firewall::iptables
# }
if $ng_include_fw == true {
include cd_nagios::firewall::iptables
}
# if $ng_use_selinux_tools == true {
# include cd_nagios::selinux::config
# }
if $ng_use_selinux_tools == true {
include cd_nagios::selinux::config
}
if $ng_enable_certbot == true {
require cd_nagios::certbot::certs

View File

@@ -327,7 +327,7 @@ $ng_enable_index = true,
# certbot
$ng_enable_certbot = true,
$ng_certbot_cert_path = '/var/www/html',
$ng_certbot_webroot = '/var/www/html',
$ng_webserver_name = "nagios.${::domain}",
) {
@@ -382,6 +382,12 @@ $ng_unless_renew_erb = 'cd_nagios/certbot/unless_renew_cert.erb'
$ng_index_html_file = '/var/www/html/index.html'
$ng_index_html_erb = 'cd_nagios/httpd/index_html.erb'
# certbot
$ng_certbot_main_dir = '/etc/letsencrypt'
$ng_certbot_archive = "${ng_certbot_main_dir}/archive"
$ng_certbot_cert = "${ng_certbot_archive}/${ng_webserver_name}/cert1.pem"
# includes must be last
include cd_nagios::main::config

View File

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