hook for haproxy working

This commit is contained in:
brunobenchimol
2021-11-15 20:08:56 -03:00
parent 5dba35e1ee
commit f47c04eeb5
9 changed files with 154 additions and 39 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
# {{ ansible_managed }}
{% for item in certbot_create_dns_deploy_hook_services %}
{% if item == 'haproxy' %}
# Assemble certificate/chain and private key into one single file for haproxy
cat $RENEWED_LINEAGE/fullchain.pem $RENEWED_LINEAGE/privkey.pem > $RENEWED_LINEAGE/`echo $RENEWED_DOMAINS|awk '{print $1"-haproxy.pem"}'`
# set proper permissions
chmod 0600 $RENEWED_LINEAGE/`echo $RENEWED_DOMAINS|awk '{print $1"-haproxy.pem"}'`
{% endif %}
{% if ansible_service_mgr == 'systemd' %}
systemctl reload {{ item }}
{% elif ansible_service_mgr == 'upstart' %}
initctl stop {{ item }} && initctl start {{ item }}
{% elif ansible_service_mgr == 'openrc' %}
rc-service {{ item }} restart
{% else %}
service {{ item }} reload
{% endif %}
{% endfor %}
+9 -1
View File
@@ -11,4 +11,12 @@ dns_{{certbot_dns_plugin}}_name={{certbot_dns_tsig_keyname}}
dns_{{certbot_dns_plugin}}_secret={{certbot_dns_key_secret}}
# TSIG key algorithm
dns_{{certbot_dns_plugin}}_algorithm={{certbot_dns_key_algorithm}}
{% endif %}
{% endif %}
{% if certbot_dns_plugin == 'cloudflare' %}
dns_cloudflare_api_token={{certbot_dns_key_secret}}
{% endif %}
{% if certbot_dns_plugin == 'digitalocean' %}
dns_digitalocean_token={{certbot_dns_key_secret}}
{% endif %}
-11
View File
@@ -1,11 +0,0 @@
#!/bin/bash
# {{ ansible_managed }}
{% for item in certbot_create_dns_renew_hook_services %}
{% if item == 'haproxy' %}
echo $RENEWED_LINEAGE > /tmp/RENEWED_LINEAGE.certbot.txt
echo $RENEWED_DOMAINS > /tmp/RENEWED_DOMAINS.certbot.txt
{% endif %}
{% endfor %}