From c48fcd99581798d9a6eae2f4bb45be99e3e9d1f7 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 16 Nov 2016 11:14:58 -0200 Subject: Adds base_path config allowing standalone cerbot installs --- manifests/init.pp | 3 ++- manifests/manage.pp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 4a31bd9..57c06fc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,4 +1,5 @@ class certbot( + $base_path = '/usr/bin', $basedir = '/var/spool/certbot', $owner = 'www-data', $pre_hook = '', @@ -36,7 +37,7 @@ class certbot( # Chosing an arbitrary minite within the hour in the hope that won't overload Let's Encrypt servers cron { 'certbot-renew': - command => "/usr/bin/${tool} renew --standalone --quiet ${real_pre_hook} ${real_post_hook}", + command => "${base_path}/${tool} renew --standalone --quiet ${real_pre_hook} ${real_post_hook}", user => 'root', hour => [ 5, 23 ], minute => "28", diff --git a/manifests/manage.pp b/manifests/manage.pp index ce14b0f..2481a8d 100644 --- a/manifests/manage.pp +++ b/manifests/manage.pp @@ -27,7 +27,7 @@ define certbot::manage( # Make sure nginx is restarted and request a certificate exec { "certbot-${name}": - command => "${real_pre_hook}/usr/bin/certbot certonly --webroot -w ${::certbot::basedir}/${name} -d ${name} ${domains} -m ${email} --rsa-key-size ${size} --agree-tos", + command => "${real_pre_hook}${certbot::base_path}/${certbot::tool} certonly --webroot -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}"], } -- cgit v1.2.3