From cac321dd9fdf1a7a5367ed1baf535453e1f0c05b Mon Sep 17 00:00:00 2001
From: Harald Pfeiffer <coding@lirion.de>
Date: Sun, 14 Apr 2024 13:44:44 +0200
Subject: bugfixes: query dict keys' existence

---
 roles/patch_debian/tasks/main.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'roles/patch_debian/tasks')

diff --git a/roles/patch_debian/tasks/main.yaml b/roles/patch_debian/tasks/main.yaml
index b9641a6..b6ab193 100644
--- a/roles/patch_debian/tasks/main.yaml
+++ b/roles/patch_debian/tasks/main.yaml
@@ -76,6 +76,7 @@
       failed_when: svcout.rc > 2
   become: true
   when:
+    - nrex.stat is defined
     - nrex.stat.exists == true
     - nrex.stat.executable == true
 - name: Clean apt cache
@@ -98,4 +99,4 @@
     test_command: uptime
     reboot_command: "/bin/systemctl reboot"
   become: true
-  when: kernout.rc > 2 or svcout.rc > 2
+  when: ( kernout.rc is defined and kernout.rc > 2 ) or ( svcout.rc is defined and svcout.rc > 2 )
-- 
cgit v1.2.3