You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
haproxy-wi/app/scripts/ansible/roles/renew_letsencrypt.j2

23 lines
529 B

#!/bin/bash
cd /etc/letsencrypt/live/
email='{{EMAIL}}'
path='{{SSL_PATH}}'
4 years ago
command='certbot certonly --standalone'
for i in $(ls -d */ |awk -F"/" '{print $1}'); do
4 years ago
echo $i
command+=" -d "$i
done
4 years ago
command+=" --non-interactive --agree-tos --email $email --http-01-port=8888"
bash -c "$command"
for i in $(ls -d */ |awk -F"/" '{print $1}'); do
bash -c "cat /etc/letsencrypt/live/$i/fullchain.pem /etc/letsencrypt/live/$i/private.pem > $path/$i.pem"
done
# Reload HAProxy
sudo systemctl reload haproxy