From 0fbb3d350b435a14939e40e6687246f4c39699b9 Mon Sep 17 00:00:00 2001 From: "Philip (a-0)" <@ph:a-0.me> Date: Fri, 22 Jul 2022 01:04:56 +0200 Subject: [PATCH] Added option to not install the certificate --- defaults/main.yml | 3 ++- tasks/main.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 4a36453..642412e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,5 @@ --- certbot_os_supported: False -certbot_immediately_execute_script: True \ No newline at end of file +certbot_immediately_execute_script: True +certbot_install_cert: True \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index 0614baa..4bf2292 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -63,7 +63,7 @@ register: live_cert - name: Obtain certificate - shell: certbot certonly --nginx --rsa-key-size 4096 {% for domain in certbot_domains %}-d {{ domain }} {% endfor %}-m {{ certbot_mail_address }} --agree-tos + shell: certbot {% if not certbot_install_cert %}certonly{% endif %} --nginx --rsa-key-size 4096 {% for domain in certbot_domains %}-d {{ domain }} {% endfor %}-m {{ certbot_mail_address }} --agree-tos when: live_cert.stat.exists == False - name: Execute post-renewal script if desired