diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-06-12 17:44:32 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-06-12 17:44:32 +0200 |
commit | f8712ca211575bdaf2e373847484b97595d754a3 (patch) | |
tree | a4b74ec53ce8f51d322e8931c7e83f8be40c1f22 /functions/conf | |
parent | Formatting cleanup. (diff) | |
download | hugonikanor-letsencrypt-f8712ca211575bdaf2e373847484b97595d754a3.tar.gz hugonikanor-letsencrypt-f8712ca211575bdaf2e373847484b97595d754a3.tar.xz |
Add apache authenticator.
Diffstat (limited to 'functions/conf')
-rw-r--r-- | functions/conf/apache.pp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/functions/conf/apache.pp b/functions/conf/apache.pp new file mode 100644 index 0000000..f51e9c1 --- /dev/null +++ b/functions/conf/apache.pp @@ -0,0 +1,25 @@ +# @summary Return hash appropriate for an `apache::vhost` +# @param cert_name +# Which certificate should be checked and used. +# @return +# A hash applicable to me used as the parameters of an +# `apache::vhost`. If SSL is configured for this domain, then SSL +# configuration is returned, otherwise non-SSL configuration is +# returned. +function letsencrypt::conf::apache( + String $cert_name, +) >> Letsencrypt::Ssl_conf::Nginx { + $cert_path = $facts['letsencrypt_directory'][$cert_name] + if $cert_path == undef { + { + ssl => false, + } + } else { + { + ssl => true, + ssl_cert => "${cert_path}/cert.pem", + ssl_key => "${cert_path}/privkey.pem", + ssl_chain => "${cert_path}/fullchain.pem", + } + } +} |