summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/certbot.pp5
-rw-r--r--manifests/init.pp5
-rw-r--r--manifests/site.pp1
3 files changed, 6 insertions, 5 deletions
diff --git a/manifests/certbot.pp b/manifests/certbot.pp
index da2c67b..98f5203 100644
--- a/manifests/certbot.pp
+++ b/manifests/certbot.pp
@@ -13,9 +13,10 @@ define nginx::certbot(
require => Package['certbot'],
}
+ # Make sure nginx is restarted and request a certificate
exec { "certbot-${name}":
- command => "/usr/bin/certbot certonly --webroot -w /var/www/certbot/${name} -d ${name} -d www.${name} -m ${email} --rsa-key-size ${size} --agree-tos",
+ command => "/usr/sbin/service nginx restart && /usr/bin/certbot certonly --webroot -w /var/www/certbot/${name} -d ${name} -d www.${name} -m ${email} --rsa-key-size ${size} --agree-tos",
creates => "/etc/letsencrypt/archive/${name}",
- require => File["/var/www/certbot/${name}"],
+ require => File["/var/www/certbot/${name}", "/etc/nginx/sites-enabled/$name"],
}
}
diff --git a/manifests/init.pp b/manifests/init.pp
index c83bad3..110a368 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -21,8 +21,9 @@ class nginx inherits nginx::base {
# Default site
nginx::site { "default":
- ensure => present,
- source => 'template',
+ ensure => present,
+ source => 'template',
+ certbot => false,
}
# Domain site
diff --git a/manifests/site.pp b/manifests/site.pp
index ec8ba69..c2a0a89 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -53,7 +53,6 @@ define nginx::site(
if $certbot == true {
nginx::certbot { $name:
ensure => $ensure,
- require => File["/etc/nginx/sites-enabled/$name"],
}
}
}