summaryrefslogtreecommitdiff
path: root/manifests/certificate.pp
blob: 14e7d2e4e7fc53825556a0995f6fc2faf158ebfd (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['hostname'],
  Letsencrypt::Authenticator $authenticator = 'nginx',
  Hash[String,Any] $config = {
    # more portable than 'systemctl reload nginx'
    'post-hook' => 'nginx -s reload',
  },
  Array[String] $default_domains = [ $trusted['hostname'], ],
) {
  include ::letsencrypt

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