From d30ddd946a56b2349baf506f99cf09a41436d9e5 Mon Sep 17 00:00:00 2001 From: FAP <459631+fapdash@users.noreply.github.com> Date: Wed, 1 Feb 2023 15:13:09 +0100 Subject: [PATCH 1/2] Run hooks only for standalone mode If the `certbot_create_method` is set to `webroot` the `stop_services` and `start_services` hook shouldn't be run. --- defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index bba711a..6903839 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -37,10 +37,10 @@ certbot_create_command: >- {{ cert_item.webroot | default(certbot_webroot) if certbot_create_method == 'webroot' else '' }} -d {{ cert_item.domains | join(',') }} {{ '--pre-hook /etc/letsencrypt/renewal-hooks/pre/stop_services' - if certbot_create_standalone_stop_services + if certbot_create_method == 'standalone' else '' }} {{ '--post-hook /etc/letsencrypt/renewal-hooks/post/start_services' - if certbot_create_standalone_stop_services + if certbot_create_method == 'standalone' else '' }} certbot_create_standalone_stop_services: From 2deba31679d170b03631e38d9283064ef615bfb5 Mon Sep 17 00:00:00 2001 From: FAP <459631+fapdash@users.noreply.github.com> Date: Mon, 20 Feb 2023 12:26:44 +0100 Subject: [PATCH 2/2] Check for both conditions (squash me) --- defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 6903839..fc81fd0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -37,10 +37,10 @@ certbot_create_command: >- {{ cert_item.webroot | default(certbot_webroot) if certbot_create_method == 'webroot' else '' }} -d {{ cert_item.domains | join(',') }} {{ '--pre-hook /etc/letsencrypt/renewal-hooks/pre/stop_services' - if certbot_create_method == 'standalone' + if certbot_create_standalone_stop_services and certbot_create_method == 'standalone' else '' }} {{ '--post-hook /etc/letsencrypt/renewal-hooks/post/start_services' - if certbot_create_method == 'standalone' + if certbot_create_standalone_stop_services and certbot_create_method == 'standalone' else '' }} certbot_create_standalone_stop_services: