Ansible-Roles/roles/certbot-dns/templates/reload_services.j2
2026-05-08 22:12:36 +03:00

24 lines
753 B
Django/Jinja

#!/bin/bash
# {{ ansible_managed }}
{% for item in certbot_create_reload_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 %}