fix(certbot): Fix hook for dovecot (too strict)
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |2654|8|2646|8|:-1: Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/411//ansiblelint">Evolix » ansible-roles » unstable #411</a>
gitea/ansible-roles/pipeline/head This commit looks good

When we use a separate certificate for POP3 and IMAP there might be
blank characters (almost certainly spaces but might as well be more lax)
before `ssl_cert` which resulted in these lines not being detected and
the hook not being played, forcing manual intervention.

This commit fixes that problem by accepting blank characters before
ssl_certs. (`\b` might be even better...)
This commit is contained in:
Mathieu Trossevin 2023-11-30 10:11:05 +01:00
parent fba894cad9
commit 0ca31b91fe
Signed by: mtrossevin
GPG key ID: D1DBB7EA828374E9
2 changed files with 2 additions and 1 deletions

View file

@ -49,6 +49,7 @@ The **patch** part changes is incremented if multiple releases happen the same m
* webapps/nextcloud: fix misplaced gid attribute
* webapps/nextcloud: fix missing gid
* check stat.exists before stat.isdir
* certbot: Fix hook for dovecot when more than one certificate is used (eg. different certificates for POP3 and IMAP)
### Removed

View file

@ -16,7 +16,7 @@ config_check() {
${doveconf_bin} > /dev/null 2>&1
}
letsencrypt_used() {
${doveconf_bin} | grep -E "^ssl_cert[^_]" | grep -q "letsencrypt"
${doveconf_bin} | grep -E "^[[:blank:]]*ssl_cert[^_]" | grep -q "letsencrypt"
}
main() {
if daemon_found_and_running; then