This commit is contained in:
2026-06-19 00:18:15 +03:00
parent eca13c9bae
commit b1d33e8ff8
2 changed files with 52 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