Optimized cloudflare implementation

This commit is contained in:
2025-04-29 02:20:10 +02:00
parent d796158c61
commit e5e394d470
13 changed files with 249 additions and 117 deletions

View File

@@ -1,3 +1,9 @@
- name: "Check if certificate already exists for {{ domain }}"
cert_check_exists:
domain: "{{ domain }}"
cert_base_path: "{{ certbot_cert_path }}"
register: cert_check
- name: "receive certificate for {{ domain }}"
command: >-
certbot certonly
@@ -21,3 +27,4 @@
{{ '--test-cert' if mode_test | bool else '' }}
register: certbot_result
changed_when: "'Certificate not yet due for renewal' not in certbot_result.stdout"
when: not cert_check.exists