Fixed an error with overwriting certbot certs.
--- a/certbot-dns-cloudflare/tasks/main.yaml Wed May 28 19:24:44 2025 -0500
+++ b/certbot-dns-cloudflare/tasks/main.yaml Thu May 29 20:01:29 2025 -0500
@@ -30,11 +30,11 @@
- name: check if cert exists
become: yes
- stat: path="/etc/letsencrypt/live/{{certbot_dns_cloudflare_domain}}-0001/cert.pem"
+ stat: path="/etc/letsencrypt/live/{{certbot_dns_cloudflare_domain}}/cert.pem"
register: cert
- name: run certbot
become: yes
- command: "certbot certonly -n --agree-tos --email {{certbot_dns_cloudflare_email}} --dns-cloudflare --dns-cloudflare-credentials /etc/letsencrypt/cred.conf -d {{certbot_dns_cloudflare_domain}} -d \"*.{{certbot_dns_cloudflare_domain}}\""
+ command: "certbot certonly -n --agree-tos --email {{certbot_dns_cloudflare_email}} --dns-cloudflare --dns-cloudflare-credentials /etc/letsencrypt/cred.conf --cert-name {{certbot_dns_cloudflare_domain}} -d {{certbot_dns_cloudflare_domain}} -d \"*.{{certbot_dns_cloudflare_domain}}\""
when: not cert.stat.exists
changed_when: false
--- a/prosody/files/prosody.sh Wed May 28 19:24:44 2025 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-#! /bin/bash
-
-prosodyctl --root cert import nth.io /etc/letsencrypt/live/nth.io-0001/fullchain.pem
--- a/prosody/tasks/main.yaml Wed May 28 19:24:44 2025 -0500
+++ b/prosody/tasks/main.yaml Thu May 29 20:01:29 2025 -0500
@@ -22,8 +22,8 @@
- name: install letsencrypt ssl deploy hook
become: yes
- copy:
- src: "prosody.sh"
+ template:
+ src: "prosody.sh.j2"
dest: "/etc/letsencrypt/renewal-hooks/deploy/prosody.sh"
mode: "0755"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/prosody/templates/prosody.sh.j2 Thu May 29 20:01:29 2025 -0500
@@ -0,0 +1,3 @@
+#! /bin/bash
+
+prosodyctl --root cert import {{prosody_vhost}} /etc/letsencrypt/live/{{prosody_vhost}}/fullchain.pem