From 1733ad2af0ff7e62f3511f2169d07f47511e5cbe Mon Sep 17 00:00:00 2001 From: ported-pw Date: Tue, 24 Dec 2024 15:47:02 +0100 Subject: [PATCH] Restart renewal service after issuing new cert with CA, reload affected services (#451) * Restart renewal service after issuing a new cert via ACME * Immediately reload affected services when a new cert is issued through ACME * Ignore errors on reloading affected services, it's not our problem here --- roles/step_acme_cert/handlers/main.yml | 5 +++++ roles/step_acme_cert/tasks/main.yml | 3 +++ 2 files changed, 8 insertions(+) diff --git a/roles/step_acme_cert/handlers/main.yml b/roles/step_acme_cert/handlers/main.yml index fd481c77..a48e6803 100644 --- a/roles/step_acme_cert/handlers/main.yml +++ b/roles/step_acme_cert/handlers/main.yml @@ -2,3 +2,8 @@ service: name: '{{ step_acme_cert_renewal_service }}' state: restarted + +- name: reload affected services + command: systemctl try-reload-or-restart {{ step_acme_cert_renewal_reload_services | join(' ') }} + when: step_acme_cert_renewal_reload_services + ignore_errors: true \ No newline at end of file diff --git a/roles/step_acme_cert/tasks/main.yml b/roles/step_acme_cert/tasks/main.yml index 6731db1c..3752d7b3 100644 --- a/roles/step_acme_cert/tasks/main.yml +++ b/roles/step_acme_cert/tasks/main.yml @@ -29,6 +29,9 @@ become_user: "{{ step_acme_cert_user }}" environment: STEPPATH: "{{ _resolved_steppath }}" + notify: + - reload affected services + - restart renewal service - name: Cert and key permissions are set file: