Prepeare RHEL Servers

This commit is contained in:
2026-06-19 00:23:26 +03:00
parent dbf1c70131
commit db45acb732
2 changed files with 0 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