aboutsummaryrefslogtreecommitdiff
path: root/manifests/domain.pp
blob: 9e6b3779960a3280de5b29fbcd028583bd17effc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# A single domain belonging to a certificate
# @example
# letsencrypt::domain { 'www.example.com':
#   cert_name => 'example.com',
# }
# @param domain_name Hostname which should be included in the target certificate
# @param cert_name Certificate to add the hostname to
define letsencrypt::domain (
  String $domain_name = $name,
  String $cert_name   = $::facts['fqdn'],
) {
  ensure_resource('letsencrypt::cert', $cert_name, {
      ensure => present,
  })

  concat::fragment { "letsencrypt ${cert_name} - ${domain_name}":
    target  => "${letsencrypt::config_dir}/env/${cert_name}",
    content => " -d ${domain_name}",
  }
}