From 80185e39dd43b74f7d7f721ac9f2262672384edc Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 21 Oct 2021 14:27:31 +0200 Subject: [PATCH] Simplify caddy config Move double conditional checking of email provision and staging environment into single check. --- roles/caddy/templates/config.json.j2 | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/roles/caddy/templates/config.json.j2 b/roles/caddy/templates/config.json.j2 index 0be7e06..b104a25 100644 --- a/roles/caddy/templates/config.json.j2 +++ b/roles/caddy/templates/config.json.j2 @@ -47,19 +47,13 @@ { "subjects": [], "issuers": [ + { {% if caddy_tls_use_staging is sameas true %} - { "ca": "https://acme-staging-v02.api.letsencrypt.org/directory", - {%- if caddy_email is not undefined and not none %} + {% endif %} + {%- if caddy_email is not undefined and not none %} "email": "{{ caddy_email }}", - {% endif %} - "module": "acme" - } - {% else %} - { - {%- if caddy_email is not undefined and not none %} - "email": "{{ caddy_email }}", - {% endif %} + {% endif %} "module": "acme" }, { @@ -68,7 +62,6 @@ {% endif %} "module": "zerossl" } - {% endif %} ] } ]