Skip to content

Instantly share code, notes, and snippets.

@psy0rz
Last active April 4, 2019 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psy0rz/6d67abad049cd57e6e33ef31abdb9409 to your computer and use it in GitHub Desktop.
Save psy0rz/6d67abad049cd57e6e33ef31abdb9409 to your computer and use it in GitHub Desktop.
### Automaticly update haproxy with letsencrypt/certbot certificates.
### Just create the files below in the hook-directories and certbot will use them. (no extra options needed, also works with certbot renew)
[root@proxy1 ~]# cat /etc/letsencrypt/renewal-hooks/deploy/haproxy
#!/bin/bash
set -e
NAME=`basename $RENEWED_LINEAGE`
cd $RENEWED_LINEAGE
cat fullchain.pem privkey.pem > $NAME.pem
mv $NAME.pem /etc/haproxy/certs/
[root@proxy1 ~]# cat /etc/letsencrypt/renewal-hooks/post/haproxy
#!/bin/bash
systemctl reload haproxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment