--- a/certbot-dns-cloudflare/tasks/main.yaml Sun Jan 21 15:58:58 2024 -0600
+++ b/certbot-dns-cloudflare/tasks/main.yaml Sun Feb 04 20:27:19 2024 -0600
@@ -13,6 +13,12 @@
owner: "root"
group: "root"
+- name: make renewal dir
+ become: yes
+ file:
+ path: "/etc/letsencrypt/renewal/"
+ state: "directory"
+
- name: configure renewal
become: yes
template:
@@ -24,11 +30,11 @@
- name: check if cert exists
become: yes
- stat: path="/etc/letsencrypt/live/{{certbot_dns_cloudflare_domain}}/cert.pem"
+ stat: path="/etc/letsencrypt/live/{{certbot_dns_cloudflare_domain}}-0001/cert.pem"
register: cert
- name: run certbot
become: yes
- command: "certbot certonly -n --dns-cloudflare --dns-cloudflare-credentials /etc/letsencrypt/cred.conf -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 -d {{certbot_dns_cloudflare_domain}} -d \"*.{{certbot_dns_cloudflare_domain}}\""
when: not cert.stat.exists
changed_when: false