]> gitweb.fluxo.info Git - puppet-certbot.git/commitdiff
Support for plugins other than standalone
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 30 May 2018 21:14:42 +0000 (18:14 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 30 May 2018 21:14:42 +0000 (18:14 -0300)
manifests/init.pp
manifests/manage.pp

index bd75c519b09b9f6405f4d09ad06327772ecd4e19..bfd7210fc16505bc629543ce76df2a4ef6e7d005 100644 (file)
@@ -4,6 +4,7 @@ class certbot(
   $owner     = 'www-data',
   $pre_hook  = '',
   $post_hook = '',
+  $plugin    = 'standalone',
 ) {
 
   $tool = $::lsbdistcodename ? {
@@ -35,9 +36,9 @@ class certbot(
     require => File[$basedir],
   }
 
-  # Chosing an arbitrary minite within the hour in the hope that won't overload Let's Encrypt servers
+  # Chosing an arbitrary minute within the hour in the hope that won't overload Let's Encrypt servers
   cron { 'certbot-renew':
-    command => "${script_base}/${tool} renew --standalone --quiet -n ${real_pre_hook} ${real_post_hook}",
+    command => "${script_base}/${tool} renew --${plugin} --quiet -n ${real_pre_hook} ${real_post_hook}",
     user    => 'root',
     hour    => [ 5, 23 ],
     minute  => "28",
index 7a3613c1f483e62249a7da792cdc541a9c188027..77cc244be322726db18b4ceb2249e853c710fe64 100644 (file)
@@ -2,6 +2,7 @@ define certbot::manage(
   $pre_hook = '',
   $aliases  = "www.${name}",
   $ensure   = present,
+  $plugin   = 'standalone',
   $email    = hiera('certbot::manage::email'),
   $size     = hiera('certbot::manage::size', '4096'),
 ){
@@ -27,7 +28,7 @@ define certbot::manage(
 
   # Make sure nginx is restarted and request a certificate
   exec { "certbot-${name}":
-    command => "${real_pre_hook}${certbot::script_base}/${certbot::tool} certonly -n --webroot -w ${::certbot::basedir}/${name} -d ${name} ${domains} -m ${email} --rsa-key-size ${size} --agree-tos",
+    command => "${real_pre_hook}${certbot::script_base}/${certbot::tool} certonly -n --${plugin} -w ${::certbot::basedir}/${name} -d ${name} ${domains} -m ${email} --rsa-key-size ${size} --agree-tos",
     creates => "/etc/letsencrypt/archive/${name}",
     require => File["${::certbot::basedir}/${name}"],
   }