summaryrefslogtreecommitdiff
path: root/manifests/certificate.pp
blob: b63086405e4b3c337e8c716453756dcdeae2c30d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Sets up a certificate for this machine.
# Should preferably be included before a letsencrypt::domain resource
# is declared.
class profiles::certificate (
  String $cert_name = $trusted['certname'],
  Letsencrypt::Authenticator $authenticator = 'nginx',
  Hash[String,Any] $config = {
    # more portable than 'systemctl reload nginx'
    'post-hook' => 'nginx -s reload',
  },
  Array[String] $default_domains = [ $trusted['certname'], ],
) {
  include ::letsencrypt

  letsencrypt::cert { $cert_name:
    domains       => $default_domains,
    authenticator => $authenticator,
    config        => $config,
  }
}