aboutsummaryrefslogtreecommitdiff
path: root/functions/conf/nginx.pp
blob: f8e61233d104ba37a6a5515dd30d03f2f4645245 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Returns a hash to be merged into a nginx::resource::server resources
# parameters. The cert_name parameter should be the name of the domain in question, and NOT the local certificate name.
function letsencrypt::conf::nginx (
  String $cert_name,
) >> Letsencrypt::Ssl_conf::Nginx {
  $cert_path = $facts['letsencrypt_directory'][$cert_name]
  if $cert_path == undef {
    {
      ssl => false,
    }
  } else {
    {
      ssl          => true,
      ssl_redirect => true,
      ssl_cert     => "${cert_path}/fullchain.pem",
      ssl_key      => "${cert_path}/privkey.pem",
    }
  }
}