From 88632e986eef566b5d863621f502ab890a15af0d Mon Sep 17 00:00:00 2001 From: Sergey Aksenov Date: Sat, 16 May 2026 18:03:54 +0200 Subject: [PATCH] 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. --- tasks/create-cert-standalone.yml | 2 +- tasks/create-cert-webroot.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/create-cert-standalone.yml b/tasks/create-cert-standalone.yml index c04eb52..4f397d9 100644 --- a/tasks/create-cert-standalone.yml +++ b/tasks/create-cert-standalone.yml @@ -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 diff --git a/tasks/create-cert-webroot.yml b/tasks/create-cert-webroot.yml index b379577..e19dad7 100644 --- a/tasks/create-cert-webroot.yml +++ b/tasks/create-cert-webroot.yml @@ -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