summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-06-16 19:40:11 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-06-16 19:40:11 -0300
commitb841d178ff55c28310cd466da6bd058c2e582c5c (patch)
treea72b06dcb3e21d897e9fd8de30517bad3f03907c /manifests
parent672097f04734e1f56513c6ce409f5fb9fd55a6e4 (diff)
downloadpuppet-nginx-b841d178ff55c28310cd466da6bd058c2e582c5c.tar.gz
puppet-nginx-b841d178ff55c28310cd466da6bd058c2e582c5c.tar.bz2
More certbot enhancements
Diffstat (limited to 'manifests')
-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"],
}
}
}