aboutsummaryrefslogtreecommitdiff
path: root/functions/conf/apache.pp
blob: f51e9c1e80a2ff942201770b8d9f09e52abb1e4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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",
    }
  }
}