diff --git a/site-modules/profile/manifests/letsencrypt.pp b/site-modules/profile/manifests/letsencrypt.pp index c1045cd2..5aa427e4 100644 --- a/site-modules/profile/manifests/letsencrypt.pp +++ b/site-modules/profile/manifests/letsencrypt.pp @@ -1,32 +1,38 @@ # Base configuration for Let's Encrypt class profile::letsencrypt { include ::profile::letsencrypt::apt_config include ::profile::letsencrypt::gandi_livedns_hook - include ::profile::letsencrypt::puppet_export_hook class {'letsencrypt': config => { email => lookup('letsencrypt::account_email'), server => lookup('letsencrypt::server'), } } $certificates = lookup('letsencrypt::certificates', Hash) $certificates.each |$key, $settings| { $domains = $settings['domains'] - ::letsencrypt::certonly {$key: + + $deploy_hook = pick($settings['deploy_hook'], 'puppet_export') + + include "::profile::letsencrypt::${deploy_hook}_hook" + $deploy_hook_path = getvar("profile::letsencrypt::${deploy_hook}_hook::hook_path") + + File[$deploy_hook_path] + -> ::letsencrypt::certonly {$key: domains => $domains, custom_plugin => true, additional_args => [ '--authenticator manual', '--preferred-challenges dns', '--manual-public-ip-logging-ok', "--manual-auth-hook '${::profile::letsencrypt::gandi_livedns_hook::hook_path} auth'", "--manual-cleanup-hook '${::profile::letsencrypt::gandi_livedns_hook::hook_path} cleanup'", - "--deploy-hook '${::profile::letsencrypt::puppet_export_hook::hook_path}'", + "--deploy-hook '${deploy_hook_path}'", ], } -> Profile::Letsencrypt::Certificate <| title == $key |> } }