From 0ed5d98fc43c3217feae1950ae8503fa42251236 Mon Sep 17 00:00:00 2001 From: Bob Belnap Date: Wed, 8 Nov 2023 11:33:15 -0500 Subject: [PATCH] enable the ability to not provision the cronjob This is useful for cases where you want to manage the cronjob with puppet, and do not want duplicate cron jobs. --- manifests/init.pp | 12 +++++++++++- manifests/params.pp | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index d34e0fb..27553d6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -22,6 +22,9 @@ # * `$manage_dependencies` # Boolean to specify whether or not to install the required package dependencies # +# * `$acme_cron_enable` +# Boolean to specify whether or not to install the cron job on install +# # Authors # ------- # @@ -41,6 +44,7 @@ String $acme_accountemail = $acme_sh::params::acme_accountemail, String $acme_version = $acme_sh::params::acme_version, Boolean $manage_dependencies = $acme_sh::params::manage_dependencies, + Boolean $acme_cron_enable = $acme_sh::params::acme_cron_enable, ) inherits acme_sh::params { if $manage_dependencies { @@ -49,6 +53,12 @@ Package[$dependencies] -> Vcsrepo[$acme_repo_path] } + if $acme_cron_enable { + $acme_cron = '' + } else { + $acme_cron = '--no-cron' + } + vcsrepo {$acme_repo_path: ensure => present, provider => git, @@ -58,7 +68,7 @@ } exec { 'acme_sh::self-install': - command => "/bin/sh ./acme.sh --install --home ${acme_home} --certhome ${acme_certhome} --accountemail \"${acme_accountemail}\"", + command => "/bin/sh ./acme.sh --install ${$acme_cron} --home ${acme_home} --certhome ${acme_certhome} --accountemail \"${acme_accountemail}\"", path => ['/bin', '/usr/bin'], cwd => $acme_repo_path, creates => $acme_home, diff --git a/manifests/params.pp b/manifests/params.pp index 6dfdfcc..bbc4cfb 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -9,5 +9,6 @@ $acme_accountemail = undef $acme_version = 'master' $manage_dependencies = false + $acme_cron_enable = true }