diff options
author | 2025-02-23 08:42:25 +0100 | |
---|---|---|
committer | 2025-03-30 17:48:54 +0200 | |
commit | df3e163ce95bfd0e5fd1cc91722d2c9832e1fff2 (patch) | |
tree | ead6e417650b208bee523fbef0c6a8ef47b29d80 /ansible/roles/certbot | |
parent | Update dependency community.general to v10.5.0 (diff) |
Reload mailserver services on certificate update
Diffstat (limited to 'ansible/roles/certbot')
-rw-r--r-- | ansible/roles/certbot/tasks/main.yml | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ansible/roles/certbot/tasks/main.yml b/ansible/roles/certbot/tasks/main.yml index c6df7a1..e6691a1 100644 --- a/ansible/roles/certbot/tasks/main.yml +++ b/ansible/roles/certbot/tasks/main.yml @@ -76,14 +76,24 @@ - role::certbot -- name: Reload nginx after certificate renewal +# BEGIN temporary cleanup task +- name: Remove old hook file + ansible.builtin.file: + path: /etc/letsencrypt/renewal-hooks/deploy/reload-nginx + state: absent +# END temporary cleanup task + +- name: Reload services after certificate renewal ansible.builtin.copy: content: | #!/bin/sh set -ex systemctl reload nginx - dest: /etc/letsencrypt/renewal-hooks/deploy/reload-nginx + {% if certbot_reload_services %} + systemctl reload {{ certbot_reload_services | join(" ") }} + {% endif %} + dest: /etc/letsencrypt/renewal-hooks/deploy/reload-services owner: root group: root mode: "0500" |