Merge branch 'jenkins' into 'master'

Jenkins

See merge request !19
This commit is contained in:
12ww1160
2017-07-21 17:15:50 +02:00
20 changed files with 155 additions and 121 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/abeba0589d446de">abeba0589d446de</a> Jenkins Server <i>2017-07-21 15:18:35</i>
<p>
<h3>recommit for updates in build 36</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/01324789d29fa72">01324789d29fa72</a> Arne Teuke <i>2017-07-21 15:18:10</i>
<p>
<h3>re-chained certbot</h3>
</p>
<a href="https://gitlab.puppetsoft.com/12WW1160/git-changelog-lib/commit/183e17f460c21ab">183e17f460c21ab</a> Jenkins Server <i>2017-07-21 15:16:28</i>
<p>
<h3>recommit for updates in build 35</h3>

View File

@@ -186,7 +186,7 @@
</div>
<div id="footer">
Generated on Fri Jul 21 17:18:30 2017 by
Generated on Fri Jul 21 17:24:53 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 Fri Jul 21 17:18:31 2017 by
Generated on Fri Jul 21 17:24:54 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 Fri Jul 21 17:18:30 2017 by
Generated on Fri Jul 21 17:24:54 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 Fri Jul 21 17:18:31 2017 by
Generated on Fri Jul 21 17:24:55 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

@@ -192,7 +192,15 @@ href="http://www.gnu.org/licenses">www.gnu.org/licenses</a>/.</p>
83
84
85
86</pre>
86
87
88
89
90
91
92
93
94</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/certbot/config.pp', line 23</span>
@@ -202,62 +210,70 @@ class cd_nagios::certbot::config (
) inherits cd_nagios::params {
if $::fqdn == $ng_nagios_server {
if $ng_enable_certbot == true {
if $ng_use_https == true {
if $ng_enable_certbot == true {
require cd_certbot
require cd_certbot
# ensure there is no forward vhost file
# 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_forward_vhost&#39;:
command =&gt; &quot;rm -Rf ${ng_forward_conf}&quot;,
creates =&gt; &#39;/etc/httpd/conf.d/.cert_created&#39;,
}
# create temp vhost file
exec { &#39;create_temp_vhost&#39;:
command =&gt; template(&#39;cd_nagios/certbot/create_tempfile.erb&#39;),
cwd =&gt; &#39;/tmp&#39;,
path =&gt; [&#39;/bin&#39;,&#39;/usr/bin&#39;],
provider =&gt; &#39;shell&#39;,
creates =&gt; &#39;/etc/httpd/conf.d/.created&#39;,
notify =&gt; Service[&#39;httpd&#39;],
require =&gt; Exec[&#39;remove_forward_vhost&#39;],
}
# create cert
exec { &#39;create_cert&#39;:
command =&gt; template($ng_get_cert_erb),
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;,
require =&gt; Exec[&#39;create_temp_vhost&#39;],
}
# remove temp_vhost
exec { &#39;remove_temp_vhost&#39;:
command =&gt; &quot;rm -Rf ${ng_certbot_temp_file}&quot;,
cwd =&gt; &#39;/tmp&#39;,
path =&gt; [&#39;/bin&#39;,&#39;/usr/bin&#39;],
provider =&gt; &#39;shell&#39;,
notify =&gt; Service[&#39;httpd&#39;],
require =&gt; Exec[&#39;create_cert&#39;],
creates =&gt; &quot;/etc/letsencrypt/live/${ng_nagios_server}/cert.pem&quot;,
}
# 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($ng_unless_renew_erb),
}
}
}
# create temp vhost file
exec { &#39;create_temp_vhost&#39;:
command =&gt; template(&#39;cd_nagios/certbot/create_tempfile.erb&#39;),
cwd =&gt; &#39;/tmp&#39;,
path =&gt; [&#39;/bin&#39;,&#39;/usr/bin&#39;],
provider =&gt; &#39;shell&#39;,
creates =&gt; &#39;/etc/httpd/conf.d/.created&#39;,
notify =&gt; Service[&#39;httpd&#39;],
}
# create cert
exec { &#39;create_cert&#39;:
command =&gt; template($ng_get_cert_erb),
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;,
}
# remove temp_vhost
exec { &#39;remove_temp_vhost&#39;:
command =&gt; &quot;rm -Rf ${ng_certbot_temp_file}&quot;,
cwd =&gt; &#39;/tmp&#39;,
path =&gt; [&#39;/bin&#39;,&#39;/usr/bin&#39;],
provider =&gt; &#39;shell&#39;,
notify =&gt; Service[&#39;httpd&#39;],
require =&gt; Exec[&#39;create_cert&#39;],
creates =&gt; &quot;/etc/letsencrypt/live/${ng_nagios_server}/cert.pem&quot;,
}
# 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($ng_unless_renew_erb),
}
else {
# do nothing as we are not using https and certbot is not required then
}
}
}</pre>
@@ -268,7 +284,7 @@ class cd_nagios::certbot::config (
</div>
<div id="footer">
Generated on Fri Jul 21 17:18:33 2017 by
Generated on Fri Jul 21 17:24:57 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 Fri Jul 21 17:18:33 2017 by
Generated on Fri Jul 21 17:24:56 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 17:18:33 2017 by
Generated on Fri Jul 21 17:24:57 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 17:18:33 2017 by
Generated on Fri Jul 21 17:24:56 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 17:18:32 2017 by
Generated on Fri Jul 21 17:24:56 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 17:18:33 2017 by
Generated on Fri Jul 21 17:24:56 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 17:18:32 2017 by
Generated on Fri Jul 21 17:24:56 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

@@ -2313,7 +2313,7 @@ $ng_certbot_temp_file = &#39;/etc/httpd/conf.d/certbot_temp.conf&#39;
</div>
<div id="footer">
Generated on Fri Jul 21 17:18:32 2017 by
Generated on Fri Jul 21 17:24:56 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 17:18:33 2017 by
Generated on Fri Jul 21 17:24:57 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 17:18:33 2017 by
Generated on Fri Jul 21 17:24:57 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

@@ -452,7 +452,7 @@ class cd_nagios::server::files (
</div>
<div id="footer">
Generated on Fri Jul 21 17:18:33 2017 by
Generated on Fri Jul 21 17:24:56 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 17:18:33 2017 by
Generated on Fri Jul 21 17:24:57 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 17:18:33 2017 by
Generated on Fri Jul 21 17:24:57 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 17:18:31 2017 by
Generated on Fri Jul 21 17:24:55 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

@@ -25,62 +25,70 @@ class cd_nagios::certbot::config (
) inherits cd_nagios::params {
if $::fqdn == $ng_nagios_server {
if $ng_enable_certbot == true {
if $ng_use_https == true {
if $ng_enable_certbot == true {
require cd_certbot
require cd_certbot
# ensure there is no forward vhost file
# 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_forward_vhost':
command => "rm -Rf ${ng_forward_conf}",
creates => '/etc/httpd/conf.d/.cert_created',
}
# create temp vhost file
exec { 'create_temp_vhost':
command => template('cd_nagios/certbot/create_tempfile.erb'),
cwd => '/tmp',
path => ['/bin','/usr/bin'],
provider => 'shell',
creates => '/etc/httpd/conf.d/.created',
notify => Service['httpd'],
require => Exec['remove_forward_vhost'],
}
# create cert
exec { 'create_cert':
command => template($ng_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',
require => Exec['create_temp_vhost'],
}
# remove temp_vhost
exec { 'remove_temp_vhost':
command => "rm -Rf ${ng_certbot_temp_file}",
cwd => '/tmp',
path => ['/bin','/usr/bin'],
provider => 'shell',
notify => Service['httpd'],
require => Exec['create_cert'],
creates => "/etc/letsencrypt/live/${ng_nagios_server}/cert.pem",
}
# renew certs
exec { 'renew_cert':
command => 'certbot renew',
cwd => '/tmp',
path => ['/bin','/usr/bin','/opt/'],
provider => 'shell',
notify => Service['httpd'],
unless => template($ng_unless_renew_erb),
}
}
}
# create temp vhost file
exec { 'create_temp_vhost':
command => template('cd_nagios/certbot/create_tempfile.erb'),
cwd => '/tmp',
path => ['/bin','/usr/bin'],
provider => 'shell',
creates => '/etc/httpd/conf.d/.created',
notify => Service['httpd'],
}
# create cert
exec { 'create_cert':
command => template($ng_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',
}
# remove temp_vhost
exec { 'remove_temp_vhost':
command => "rm -Rf ${ng_certbot_temp_file}",
cwd => '/tmp',
path => ['/bin','/usr/bin'],
provider => 'shell',
notify => Service['httpd'],
require => Exec['create_cert'],
creates => "/etc/letsencrypt/live/${ng_nagios_server}/cert.pem",
}
# renew certs
exec { 'renew_cert':
command => 'certbot renew',
cwd => '/tmp',
path => ['/bin','/usr/bin','/opt/'],
provider => 'shell',
notify => Service['httpd'],
unless => template($ng_unless_renew_erb),
}
else {
# do nothing as we are not using https and certbot is not required then
}
}
}