summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-02-06 14:22:59 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-02-09 18:06:59 +0100
commit193286d30f6992984de2ee698116c82f43b25b96 (patch)
treedb683c3ef8e6e1c367f0b1da941a55b13e7fea1a
parentAdd nginx profile. (diff)
downloadprofiles-193286d30f6992984de2ee698116c82f43b25b96.tar.gz
profiles-193286d30f6992984de2ee698116c82f43b25b96.tar.xz
Profile letsencrypt stop depending on hiera.
-rw-r--r--manifests/letsencrypt.pp18
1 files changed, 14 insertions, 4 deletions
diff --git a/manifests/letsencrypt.pp b/manifests/letsencrypt.pp
index b040724..64f4f82 100644
--- a/manifests/letsencrypt.pp
+++ b/manifests/letsencrypt.pp
@@ -1,9 +1,8 @@
+# Sets up letsencrypt for this host
class profiles::letsencrypt (
- String $certname,
- Array[String] $domains,
+ String $certname = $::fqdn,
+ Array[String] $domains = [ $::fqdn, ],
Enum['nginx','apache'] $provider,
- Optional[String] $nginx_plugin = undef,
- Optional[String] $apache_plugin = undef,
) {
include ::letsencrypt
@@ -14,6 +13,17 @@ class profiles::letsencrypt (
'apache' => 'systemctl restart apache2.service',
}
+ case $facts['os']['family'] {
+ 'Debian': {
+ $nginx_plugin = 'python3-certbot-nginx'
+ $apache_plugin = 'python3-certbot-apache'
+ }
+ 'Archlinux': {
+ $nginx_plugin = 'certbot-nginx'
+ $apache_plugin = 'certbot-apache'
+ }
+ }
+
case $provider {
'apache': {
ensure_packages ([$apache_plugin])