aboutsummaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp24
1 files changed, 17 insertions, 7 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 0fedb85..cc72b32 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -1,28 +1,38 @@
+# @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,
- String $default_cert_name = $::fqdn,
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,
}
- file { "${config_dir}/cli.ini":
- content = @("EOF")
- email = $email
+ $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)
}