mirror of
https://github.com/geerlingguy/ansible-role-certbot.git
synced 2025-04-19 17:01:37 +02:00
Check for systemd list-unit-files before restarting services
Co-authored-by: Karl M. Davis <karl@justdavis.com>
This commit is contained in:
parent
7a7c1f8b06
commit
52a96f9bde
@ -60,4 +60,9 @@ certbot_keep_updated: true
|
|||||||
certbot_dir: /opt/certbot
|
certbot_dir: /opt/certbot
|
||||||
|
|
||||||
# Restart this service after successfull certificate creation:
|
# Restart this service after successfull certificate creation:
|
||||||
certbot_deployhook: "service {{ certbot_create_standalone_stop_services | join(' restart && service ') }} restart"
|
certbot_deployhook: |
|
||||||
|
{% for service in certbot_create_standalone_stop_services %}
|
||||||
|
if systemctl list-unit-files | grep -q "^{{ service }}.service"; then
|
||||||
|
systemctl restart {{ service }}
|
||||||
|
fi
|
||||||
|
{% endfor %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user