From 870cdd163b878b8e2e0c6845630a2c89674fd447 Mon Sep 17 00:00:00 2001
From: Yohann D'ANELLO <ynerant@crans.org>
Date: Thu, 4 Mar 2021 11:36:29 +0100
Subject: [PATCH] [certbot] No change when certificates are already renewed

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
---
 roles/certbot/tasks/main.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/roles/certbot/tasks/main.yml b/roles/certbot/tasks/main.yml
index 91e2fde8..90fe154f 100644
--- a/roles/certbot/tasks/main.yml
+++ b/roles/certbot/tasks/main.yml
@@ -45,6 +45,8 @@
 
 - name: Run certbot
   command: certbot --non-interactive --config /etc/letsencrypt/conf.d/{{ item.certname }}.ini certonly
+  register: certbot_output
+  changed_when: not "Certificate not yet due for renewal" in certbot_output.stdout
   loop: "{{ certbot }}"
 
 - name: Clean old files
-- 
GitLab