From 29b5c0711b5cc89819292eddf68f126ca84378d2 Mon Sep 17 00:00:00 2001 From: vincent Date: Sat, 17 Jul 2021 09:42:41 +0200 Subject: [PATCH] add hook to certbot command --- defaults/main.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 084f9a9..8542e3b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -21,9 +21,17 @@ certbot_certs: [] # - example3.com certbot_create_command: >- {{ certbot_script }} certonly --standalone --noninteractive --agree-tos - {% if certbot_cert_name %} --cert-name {{certbot_cert_name}} {%endif%} + {% if certbot_cert_name %} + --cert-name {{certbot_cert_name}} + {%endif%} --email {{ cert_item.email | default(certbot_admin_email) }} -d {{ cert_item.domains | join(',') }} + {{ '--pre-hook /etc/letsencrypt/renewal-hooks/pre/stop_services' + if certbot_create_standalone_stop_services + else '' }} + {{ '--post-hook /etc/letsencrypt/renewal-hooks/post/start_services' + if certbot_create_standalone_stop_services + else '' }} certbot_create_standalone_stop_services: - nginx