From cd0c7019a911acd3167088bda4378c8a11706aeb Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 22 Jul 2022 20:18:39 -0400 Subject: [PATCH 1/3] fix(config): add missing requisite --- letsencrypt/config.sls | 2 ++ 1 file changed, 2 insertions(+) diff --git a/letsencrypt/config.sls b/letsencrypt/config.sls index c1cee5d..921f2e6 100644 --- a/letsencrypt/config.sls +++ b/letsencrypt/config.sls @@ -20,3 +20,5 @@ letsencrypt-config: - makedirs: true - context: config: {{ letsencrypt.config | json }} + - require: + - file: letsencrypt-config-directory From 5646457341f22d5814c637b3eb404b7df2dbb3d6 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 23 Jul 2022 00:20:01 -0400 Subject: [PATCH 2/3] fix(domains): add missing includes and requisites --- letsencrypt/domains.sls | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/letsencrypt/domains.sls b/letsencrypt/domains.sls index 2e552c7..3b34ab6 100644 --- a/letsencrypt/domains.sls +++ b/letsencrypt/domains.sls @@ -3,6 +3,10 @@ {% from "letsencrypt/map.jinja" import letsencrypt with context %} +include: + - letsencrypt.install + - letsencrypt.config + {% if letsencrypt.install_method == 'package' %} {% set check_cert_cmd = letsencrypt._cli_path ~ ' certificates --cert-name' %} {% set renew_cert_cmd = letsencrypt._cli_path ~ ' renew' %} @@ -30,6 +34,12 @@ - template: jinja - source: salt://letsencrypt/files/check_letsencrypt_cert.sh.jinja - mode: 755 + - require: + {%- if letsencrypt.install_method == 'git' %} + - git: letsencrypt-client + {%- elif letsencrypt.install_method == 'pip' %} + - virtualenv: letsencrypt-client + {%- endif %} {{ renew_cert_cmd }}: file.{{ old_renew_cert_cmd_state }}: From 8bb89bd76e9ad0ed8783b8d30d415ac3e0f1bf08 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 23 Jul 2022 16:08:55 -0400 Subject: [PATCH 3/3] fix(domains): ignore requisites when removing crontab entry --- letsencrypt/domains.sls | 2 ++ 1 file changed, 2 insertions(+) diff --git a/letsencrypt/domains.sls b/letsencrypt/domains.sls index 3b34ab6..a0c488f 100644 --- a/letsencrypt/domains.sls +++ b/letsencrypt/domains.sls @@ -107,6 +107,7 @@ letsencrypt-crontab-{{ setname }}-{{ domainlist[0] }}: - hour: '{{ letsencrypt.cron.hour }}' - dayweek: '{{ letsencrypt.cron.dayweek }}' - identifier: letsencrypt-{{ setname }}-{{ domainlist[0] }} + {%- if old_cron_state == 'present' %} - require: - cmd: create-initial-cert-{{ setname }}-{{ domainlist | join('+') }} {% if letsencrypt.install_method == 'package' %} @@ -114,6 +115,7 @@ letsencrypt-crontab-{{ setname }}-{{ domainlist[0] }}: {% else %} - file: {{ renew_cert_cmd }} {% endif %} + {%- endif %} create-fullchain-privkey-pem-for-{{ setname }}: cmd.run: