diff --git a/templates/usr/local/bin/haproxy-letsencrypt-ocsp-deploy.j2 b/templates/usr/local/bin/haproxy-letsencrypt-ocsp-deploy.j2 index 47d05c70..3d15666d 100644 --- a/templates/usr/local/bin/haproxy-letsencrypt-ocsp-deploy.j2 +++ b/templates/usr/local/bin/haproxy-letsencrypt-ocsp-deploy.j2 @@ -35,6 +35,8 @@ for path in $(ls -1d {{ haproxy_letsencrypt_ssl_src_path }}/*/); do rm -f "{{ haproxy_global_crt_base }}/${removePrefix}-${cert}.pem.ocsp"; done +find "{{ haproxy_global_crt_base }}" -mindepth 1 -name "*.ocsp" -mtime +0 -delete; + {% if ansible_service_mgr == 'systemd' %} systemctl reload haproxy; {% else %} diff --git a/templates/usr/local/bin/haproxy-letsencrypt-ssl-deploy.j2 b/templates/usr/local/bin/haproxy-letsencrypt-ssl-deploy.j2 index b4a2f2d7..0b43b40c 100644 --- a/templates/usr/local/bin/haproxy-letsencrypt-ssl-deploy.j2 +++ b/templates/usr/local/bin/haproxy-letsencrypt-ssl-deploy.j2 @@ -29,4 +29,6 @@ for path in $(ls -1d {{ haproxy_letsencrypt_ssl_src_path }}/*/); do rm -f "{{ haproxy_global_crt_base }}/${removePrefix}-${cert}.pem"; done +find "{{ haproxy_global_crt_base }}" -mindepth 1 -name "*.pem" -mtime +0 -delete; + {{ haproxy_letsencrypt_ocsp_deploy }};