This commit is contained in:
2026-06-18 23:18:11 +03:00
parent 22f030ff7b
commit 2868f76761
9 changed files with 181 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
- name: Update all system packages
hosts: all
become: yes
tasks:
- name: Update packages to the latest version
dnf: name="*" state=latest
- name: Check if a reboot is required
command:
cmd: needs-restarting -r
register: reboot_check
changed_when: false
failed_when: reboot_check.rc not in [0, 1]
- name: Reboot the server only if needed
reboot:
when: reboot_check.rc == 1