Forked from https://github.com/opus-codium/puppet-dehydrated
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with dehydrated
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
The dehydrated module lets you use Puppet to manage Let's Encrypt certificates creation and renewal using dehydrated.
Let's encrypt needs a contact address that must be passed to the dehydrated
class:
class { 'dehydrated':
email => 'user@example.com',
}
This is enough to get started and creating certificates.
After including the required dehydrated
class, each dehydrated::certificate
will produce a single certificate file:
class { 'dehydrated':
email => 'user@example.com',
}
dehydrated::certificate { 'example.com':
}
A dehydrated::certificate
can use the domain
parameter to indicate Subject Alternative Names (SAN).
class { 'dehydrated':
email => 'user@example.com',
}
dehydrated::certificate { 'example.com':
domains => [
'www.example.com',
'example.net',
'www.example.net'
],
}
The cron_enabled
parameter of the dehydrated
class configures cron to renew certificates before they expire.
class { 'dehydrated':
email => 'user@example.com',
cron_enabled => true,
}
The module can be integrated with the puppetlabs apache module to serve the challenges used for domain validation.
The following example redirects all HTTP requests to HTTPS except those related to letsencrypt's validation:
class { 'dehydrated':
email => 'user@example.com',
}
include ::apache
apache::vhost { 'main':
port => 80,
default_vhost => true,
docroot => '/var/empty',
manage_docroot => false,
directories => [
{
path => '/var/empty',
rewrites => [
{
rewrite_rule => '.* https://%{HTTP_HOST}%{REQUEST_URI} [R=301]',
},
],
},
],
}
apache::custom_config { 'dehydrated':
source => "puppet:///modules/profiles/dehydrated/apache_alias.conf",
}
Alias /.well-known/acme-challenge/ /var/lib/dehydrated/.acme-challenges/
<Directory /var/lib/dehydrated/.acme-challenges>
Require all granted
</Directory>
This module assumes you're starting from scratch and not migrating from letsencrypt.sh. It makes no attempt to migrate your configuration.
Main class used to setup the system.
email
: The e-mail address Let's Encrypt can use to reach you regarding your certificates.
user
: Specifies the user account used to manage certificates. Default: 'dehydrated'.group
: Specifies the group account used to manage certificates. Default: 'dehydrated'.staging_enabled
: Specifies whether to use the lets encrypt staging server. Default: 'false'.cron_enabled
: Specifies whether to setup cron to automatically renew certificates. Default: 'true'.
Class used to describe the certificates that should be maintained.
domains
: Specifies the list of domains to include as SAN (Subject Alternative Names).