Puppet Class: letsencrypt
- Defined in:
- manifests/init.pp
Summary
Install and configure Certbot, the LetsEncrypt clientOverview
Install and configure Certbot, the LetsEncrypt client
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'manifests/init.pp', line 63
class letsencrypt (
Boolean $configure_epel,
Optional[String] $email = undef,
Array $environment = [],
String $package_name = 'certbot',
String[1] $package_ensure = 'installed',
String $package_command = 'certbot',
Stdlib::Unixpath $config_dir = '/etc/letsencrypt',
String $config_file = "${config_dir}/cli.ini",
Hash $config = { 'server' => 'https://acme-v02.api.letsencrypt.org/directory' },
String $cron_scripts_path = "${facts['puppet_vardir']}/letsencrypt",
String $cron_owner_group = 'root',
Boolean $manage_config = true,
Boolean $manage_install = true,
Boolean $agree_tos = true,
Boolean $unsafe_registration = false,
Integer[2048] $key_size = 4096,
Hash[String[1],Hash] $certificates = {},
# $renew_* should only be used in letsencrypt::renew (blame rspec)
Variant[String[1], Array[String[1]]] $renew_pre_hook_commands = [],
Variant[String[1], Array[String[1]]] $renew_post_hook_commands = [],
Variant[String[1], Array[String[1]]] $renew_deploy_hook_commands = [],
Variant[String[1], Array[String[1]]] $renew_additional_args = [],
String[1] $renew_cron_ensure = 'absent',
Letsencrypt::Cron::Hour $renew_cron_hour = fqdn_rand(24),
Letsencrypt::Cron::Minute $renew_cron_minute = fqdn_rand(60),
Letsencrypt::Cron::Monthday $renew_cron_monthday = '*',
# define default hooks for all certonly defined resources
Array[String[1]] $certonly_pre_hook_commands = [],
Array[String[1]] $certonly_post_hook_commands = [],
Array[String[1]] $certonly_deploy_hook_commands = [],
) {
if $manage_install {
contain letsencrypt::install # lint:ignore:relative_classname_inclusion
Class['letsencrypt::install'] -> Class['letsencrypt::renew']
}
$command = $package_command
if $manage_config {
contain letsencrypt::config # lint:ignore:relative_classname_inclusion
}
contain letsencrypt::renew
$certificates.each |$certificate, $properties| {
letsencrypt::certonly { $certificate: * => $properties }
}
}
|