# @summary Sets up letsencrypt for other classes # @param email Contact email sent to letsencrypt # @param config_dir Location of configuration files # @param default_cert Should a certificate be automatically configured # @param default_cert_name # The name (and domain) of the automatically configured centificate. class letsencrypt ( String $email, Stdlib::Unixpath $config_dir = '/etc/letsencrypt', String $default_cert_name = $::facts['fqdn'], Boolean $default_cert = true, # TODO renewal provider here? ) { if $default_cert { letsencrypt::cert { $default_cert_name: ensure => present, } } file { $config_dir: ensure => directory, } $cli_conf = @("EOF") email = ${email} | EOF file { "${config_dir}/cli.ini": content => $cli_conf, } include letsencrypt::renew::setup # Boolean indicating if ssl is configured. Mainly used by # letsencrypt::nginx and similar classes to determine their export # of their variable $ssl. $ssl_configured = 'letsencrypt_director$' in keys($facts) }