aboutsummaryrefslogtreecommitdiff
path: root/functions/conf/nginx/location.pp
blob: 19572f3be1ddbfc9cfa075eb584d5cd357a120c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Returns a hash to be merged into a nginx::resource::location resource.
# @param cert_name
#   Domain for which we want the configuration.
#   NOT the local certificate name.
# @return hash usable with nginx::resource::location
function letsencrypt::conf::nginx::location (
  String $cert_name,
) >> Letsencrypt::Ssl_conf::Nginx::Location {
  $cert_path = $facts['letsencrypt_directory'][$cert_name]

  if $cert_path == undef {
    {
      ssl => false,
    }
  } else {
    {
      ssl      => true,
      ssl_only => true,
    }
  }
}