aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-10-19 01:06:00 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-10-19 01:06:00 +0200
commit540e2a2739a987be0aef3be2d49387d61799c58c (patch)
tree88ad447fe26f87a3f8a9761df99c6a1d6e9aedaa
parentBump to 0.3.0. (diff)
downloadhugonikanor-letsencrypt-540e2a2739a987be0aef3be2d49387d61799c58c.tar.gz
hugonikanor-letsencrypt-540e2a2739a987be0aef3be2d49387d61799c58c.tar.xz
Support FreeBSD and periodic.
-rw-r--r--README.md2
-rw-r--r--data/os/FreeBSD.yaml8
-rw-r--r--manifests/init.pp4
-rw-r--r--manifests/renew/periodic.pp7
-rw-r--r--manifests/renew/periodic/setup.pp5
-rw-r--r--metadata.json6
6 files changed, 28 insertions, 4 deletions
diff --git a/README.md b/README.md
index 2012eaf..873cab1 100644
--- a/README.md
+++ b/README.md
@@ -95,7 +95,7 @@ certificate is used, even though the usual configuration uses the certificates
on the same web server which was used for authentication. Currently only nginx
is supported.
-### Facts
+### Facter Facts
#### `letsencrypt_bycertname`
A hash from each certificates locally chosen name, to its directory in the
diff --git a/data/os/FreeBSD.yaml b/data/os/FreeBSD.yaml
index 6e2fe58..cdea88a 100644
--- a/data/os/FreeBSD.yaml
+++ b/data/os/FreeBSD.yaml
@@ -1,3 +1,7 @@
---
-letsencrypt::nginx::certbot_plugin_package: py38-certbot-nginx
-letsencrypt::apache::certbot_plugin_package: py38-certbot-apache
+letsencrypt::certbot_package: py39-certbot
+letsencrypt::nginx::certbot_plugin_package: py39-certbot-nginx
+letsencrypt::apache::certbot_plugin_package: py39-certbot-apache
+
+letsencrypt::renewal_provider: periodic
+letsencrypt::config_dir: /usr/local/etc/letsencrypt
diff --git a/manifests/init.pp b/manifests/init.pp
index d6fb5f6..9ac1b0a 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -12,6 +12,8 @@
# Default configuration values to pass to certbot. $server and
# $email is added here if not explicitly set. It's later merged with
# a specific instance for each certificate.
+# @param config_dir
+# Storage location form letsencrypt files.
class letsencrypt (
String $email,
Letsencrypt::Renewal_provider $renewal_provider, # hiera
@@ -19,6 +21,7 @@ class letsencrypt (
Boolean $manage_package = true,
String $server = 'https://acme-v02.api.letsencrypt.org/directory',
Hash[String, Any] $config = {},
+ String $config_dir = '/etc/letsencrypt'
) {
# if $default_cert {
# letsencrypt::cert { $default_cert_name:
@@ -30,7 +33,6 @@ class letsencrypt (
# not accept them in other places. This might prove wrong (BSD?), in
# that case: make them parameters again, and resolve the few remaining
# instances where they are hard coded.
- $config_dir = '/etc/letsencrypt'
$cert_dir = "${config_dir}/live"
# Used by letsencrypt::cert
diff --git a/manifests/renew/periodic.pp b/manifests/renew/periodic.pp
new file mode 100644
index 0000000..ec32fae
--- /dev/null
+++ b/manifests/renew/periodic.pp
@@ -0,0 +1,7 @@
+# @api private
+class letsencrypt::renew::periodic (
+) {
+ periodic { 'weekly_certbot_enable':
+ value => 'YES',
+ }
+}
diff --git a/manifests/renew/periodic/setup.pp b/manifests/renew/periodic/setup.pp
new file mode 100644
index 0000000..75bb5e8
--- /dev/null
+++ b/manifests/renew/periodic/setup.pp
@@ -0,0 +1,5 @@
+# @summary Handles renewal of certificates through FreeBSD's periodic system
+# @api private
+class letsencrypt::renew::periodic::setup (
+) {
+}
diff --git a/metadata.json b/metadata.json
index f11be8d..cdba246 100644
--- a/metadata.json
+++ b/metadata.json
@@ -23,6 +23,12 @@
"7",
"8"
]
+ },
+ {
+ "operatingsystem": "FreeBSD",
+ "operatingsystemrelease": [
+ "13.2"
+ ]
}
],
"requirements": [