File tree Expand file tree Collapse file tree
infra/roles/services/reverse-proxy/letsencrypt/handlers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11- name : Bootstrap SSL
22 become_user : nginx
33 when : website.ssl and website.domain
4- shell : |
5- # Check if certificate exists and is self-signed
4+ shell : |-
65 if [ -f "{{ podman.volumes_dir }}/letsencrypt/conf/live/{{ website.domain }}/fullchain.pem" ]; then
7- # Check if certificate is self-signed by looking at the issuer
8- is_self_signed=$(openssl x509 -in "{{ podman.volumes_dir }}/letsencrypt/conf/live/{{ website.domain }}/fullchain.pem" -issuer -noout | grep -i 'CN={{ website.domain }}')
6+ is_self_signed=$(openssl x509 -in "{{ podman.volumes_dir }}/letsencrypt/conf/live/{{ website.domain }}/fullchain.pem" -issuer -noout | grep -i "CN={{ website.domain }}")
97
108 if [ -n "$is_self_signed" ]; then
11- # Certificate is self-signed, replace with Let's Encrypt certificate
129 rm -rf {{ podman.volumes_dir }}/letsencrypt/conf/*
1310
1411 podman run \
2118 podman kill -s SIGHUP systemd-nginx
2219 fi
2320 else
24- # No certificate exists yet, something went wrong
2521 echo "Error: Expected certificate files not found"
2622 exit 1
2723 fi
You can’t perform that action at this time.
0 commit comments