From 66dabb4ea24b6f71128c1410040c06ea90094a2a Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 14 Oct 2018 06:40:15 -0400 Subject: point certbot at a different directory instead of using a symlink can't make a symlink at a place that a package expects to create a real directory --- modules/certbot/files/certbot | 3 --- modules/certbot/manifests/init.pp | 13 ++++++++++--- modules/certbot/templates/certbot | 3 +++ 3 files changed, 13 insertions(+), 6 deletions(-) delete mode 100644 modules/certbot/files/certbot create mode 100644 modules/certbot/templates/certbot (limited to 'modules/certbot') diff --git a/modules/certbot/files/certbot b/modules/certbot/files/certbot deleted file mode 100644 index 3e42fdd..0000000 --- a/modules/certbot/files/certbot +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -certbot renew -q diff --git a/modules/certbot/manifests/init.pp b/modules/certbot/manifests/init.pp index b4fffab..c3f0c9e 100644 --- a/modules/certbot/manifests/init.pp +++ b/modules/certbot/manifests/init.pp @@ -1,4 +1,11 @@ -class certbot { +class certbot($config_dir=undef) { + if $config_dir { + $config_dir_opts = " --config-dir ${config_dir}" + } + else { + $config_dir_opts = "" + } + include cron include nginx @@ -12,7 +19,7 @@ class certbot { file { '/etc/cron.daily/certbot': - source => 'puppet:///modules/certbot/certbot', + content => template('certbot/certbot'), mode => '0755', require => [ Package['certbot'], @@ -31,7 +38,7 @@ class certbot { exec { "initial certbot run": # XXX update to real domain name - command => "/usr/bin/certbot -n --agree-tos -m doy@tozt.net --nginx -d new.tozt.net", + command => "/usr/bin/certbot -n --agree-tos -m doy@tozt.net --nginx -d new.tozt.net${config_dir_opts}", creates => "/etc/letsencrypt/live", require => [ Package["certbot"], diff --git a/modules/certbot/templates/certbot b/modules/certbot/templates/certbot new file mode 100644 index 0000000..9568fe1 --- /dev/null +++ b/modules/certbot/templates/certbot @@ -0,0 +1,3 @@ +#!/bin/sh + +certbot renew -q<%= @config_dir_opts %> -- cgit v1.2.3-54-g00ecf