mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2026-09-11 16:21:15 +02:00
hook for haproxy working
This commit is contained in:
@@ -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 %}
|
||||
@@ -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 %}
|
||||
|
||||
@@ -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 %}
|
||||
Reference in New Issue
Block a user