From f3b37d393486a7b90e35679b445329d36e227f56 Mon Sep 17 00:00:00 2001 From: "Philip (a-0)" <@ph:a-0.me> Date: Fri, 22 Jul 2022 00:45:12 +0200 Subject: [PATCH] Added option to immediately execute renewal script --- defaults/main.yml | 1 + tasks/main.yml | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 59bc784..4a36453 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,4 @@ --- certbot_os_supported: False +certbot_immediately_execute_script: True \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index 0f10097..aac8c62 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -59,4 +59,8 @@ - name: Obtain certificate shell: certbot certonly --standalone --rsa-key-size 4096 {% for domain in certbot_domains %}-d {{ domain }} {% endfor %}-m {{ certbot_mail_address }} --agree-tos - when: live_cert.stat.exists == False \ No newline at end of file + when: live_cert.stat.exists == False + +- name: Execute post-renewal script if desired + shell: "{{ certbot_renewal_scripts_path }}{{ certbot_domains[0] }}.sh" + when: certbot_immediately_execute_script \ No newline at end of file