From ec8c074c2ab5ce45d9e1ab3b6c046ade9fa86c6d Mon Sep 17 00:00:00 2001 From: Wendell Jones Date: Wed, 10 Sep 2025 08:26:46 -0400 Subject: [PATCH] refactor: add check for reboot requirement before executing reboot task in linux_updates.yaml --- linux_updates.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/linux_updates.yaml b/linux_updates.yaml index a0986d5..7f780b3 100644 --- a/linux_updates.yaml +++ b/linux_updates.yaml @@ -36,13 +36,16 @@ # - name: Clean up unused dependencies # ansible.builtin.apt: # autoremove: yes + - name: Check if a file exists + ansible.builtin.stat: + path: /var/run/reboot-required + register: reboot_required_file + - name: Reboot if required ansible.builtin.reboot: reboot_timeout: 120 # Adjust timeout as needed when: reboot_required_file.stat.exists - vars: - reboot_required_file: /var/run/reboot-required - + #- hosts: apkhosts # tasks: # - name: Update the Package Repositories