changed check

This commit is contained in:
Arne Teuke
2017-07-23 10:26:44 +01:00
parent 5a673baf41
commit b89e386af0
3 changed files with 9 additions and 4 deletions

View File

@@ -40,7 +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',
creates => $ng_certbot_cert,
}
# renew 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 %>