Makes a single systcmtl call in pre- and post-renewal hooks

This commit is contained in:
Frank Sachsenheim 2020-12-18 16:37:19 +01:00
parent 2da7a3f2b6
commit 878c8e2664
2 changed files with 12 additions and 8 deletions

View File

@ -1,11 +1,12 @@
#!/bin/bash
#!/bin/sh
# {{ ansible_managed }}
{% if ansible_service_mgr == 'systemd' %}
systemctl start {{ certbot_create_standalone_stop_services | join(" ") }}
{% else %}
{% for item in certbot_create_standalone_stop_services %}
echo "starting service {{ item }}"
{% if ansible_service_mgr == 'systemd' %}
systemctl start {{ item }}
{% elif ansible_service_mgr == 'upstart' %}
{% if ansible_service_mgr == 'upstart' %}
initctl start {{ item }}
{% elif ansible_service_mgr == 'openrc' %}
rc-service {{ item }} start
@ -13,3 +14,4 @@ rc-service {{ item }} start
service {{ item }} start
{% endif %}
{% endfor %}
{% endif %}

View File

@ -1,11 +1,12 @@
#!/bin/bash
#!/bin/sh
# {{ ansible_managed }}
{% if ansible_service_mgr == 'systemd' %}
systemctl stop {{ certbot_create_standalone_stop_services | join(" ") }}
{% else %}
{% for item in certbot_create_standalone_stop_services %}
echo "stopping service {{ item }}"
{% if ansible_service_mgr == 'systemd' %}
systemctl stop {{ item }}
{% elif ansible_service_mgr == 'upstart' %}
{% if ansible_service_mgr == 'upstart' %}
initctl stop {{ item }}
{% elif ansible_service_mgr == 'openrc' %}
rc-service {{ item }} stop
@ -13,3 +14,4 @@ rc-service {{ item }} stop
service {{ item }} stop
{% endif %}
{% endfor %}
{% endif %}