mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2026-05-28 13:31:15 +02:00
Recognise certbot 5.x "Identifiers" field in domain check
certbot 5.x renamed the field in `certbot certificates` output from "Domains:" to "Identifiers:". The "Check if domains have changed" task greps that output for "Domains" to read a certificate's current domains. On certbot 5.x the grep matches nothing, so letsencrypt_cert_domains becomes empty, letsencrypt_cert_domains_changed is always true, and every certificate is reissued on every run. Match both the old "Domains" and new "Identifiers" labels in create-cert-standalone.yml and create-cert-webroot.yml so the check works on certbot 4.x and 5.x alike.
This commit is contained in:
parent
1011113914
commit
88632e986e
@ -44,7 +44,7 @@
|
||||
- name: Check if domains have changed
|
||||
block:
|
||||
- name: Register certificate domains
|
||||
shell: "{{ certbot_script }} certificates --cert-name {{ cert_item_name }} | grep Domains | cut -d':' -f2"
|
||||
shell: "{{ certbot_script }} certificates --cert-name {{ cert_item_name }} | grep -E 'Domains|Identifiers' | cut -d':' -f2"
|
||||
changed_when: false
|
||||
register: letsencrypt_cert_domains_dirty
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
- name: Check if domains have changed
|
||||
block:
|
||||
- name: Register certificate domains
|
||||
shell: "{{ certbot_script }} certificates --cert-name {{ cert_item_name }} | grep Domains | cut -d':' -f2"
|
||||
shell: "{{ certbot_script }} certificates --cert-name {{ cert_item_name }} | grep -E 'Domains|Identifiers' | cut -d':' -f2"
|
||||
changed_when: false
|
||||
register: letsencrypt_cert_domains_dirty
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user