re-chained certbot

This commit is contained in:
Arne Teuke
2017-07-21 16:15:59 +01:00
parent 3923a4adc5
commit 0d2f0ae3e8
5 changed files with 164 additions and 50 deletions

View File

@@ -29,6 +29,24 @@ class cd_nagios::certbot::config (
require cd_certbot
# ensure there is no forward vhost file
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'],
}
# create cert
exec { 'create_cert':
@@ -41,6 +59,18 @@ class cd_nagios::certbot::config (
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':