From 3a6efe1f0277c65910fe69c572edda5264c05e3d Mon Sep 17 00:00:00 2001
From: David Kilias <david.kilias@gmail.com>
Date: Sat, 29 Jul 2023 01:44:30 +0200
Subject: [PATCH] add handler to restart cron service after on cronjob change

---
 host-pottwal.yml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/host-pottwal.yml b/host-pottwal.yml
index 78e9af4..5816f36 100644
--- a/host-pottwal.yml
+++ b/host-pottwal.yml
@@ -534,6 +534,7 @@
         src: templates/pottwal/renovate-cron.j2
         dest: /etc/cron.hourly/renovate-bot
         mode: "0700"
+      notify: reload cron
 
   handlers:
     - name: Restart prosody
@@ -546,3 +547,12 @@
       service:
         name: apache2
         state: restarted
+
+    - name: reload cron
+      ansible.builtin.shell:
+        cmd: service cron reload
+        warn: no
+    # Use the shell call because the task sometimes has problems finding the service state
+    #  service:
+    #    name: cron
+    #    state: restarted
\ No newline at end of file