move reboot tasks to block

This commit is contained in:
alessandrovitali committed 2026-09-04 00:55:38 +02:00
1 parent 2ce3c968f9
commit 6dc9eafbde
1 file changed
+11 -9
+11 -9
View File
@@ -36,13 +36,15 @@
# mode: "0644" # mode: "0644"
# when: ansible_facts['os_family'] == "Debian" # when: ansible_facts['os_family'] == "Debian"
- name: Check if reboot is required - name: Reboot system if required
ansible.builtin.stat: block:
path: /var/run/reboot-required - name: Check if reboot is required
register: reboot_required_file ansible.builtin.stat:
path: /var/run/reboot-required
register: reboot_required_file
- name: Reboot host if necessary - name: Reboot host if necessary
ansible.builtin.reboot: become: true
post_reboot_delay: 10 ansible.builtin.reboot:
become: true post_reboot_delay: 10
when: reboot_required_file.stat.exists when: reboot_required_file.stat.exists