From d57ef6aada9abefef0d0ba8f9c6f6fcf2e1ebcf4 Mon Sep 17 00:00:00 2001
From: entlein <einentlein@gmail.com>
Date: Thu, 4 Aug 2022 14:59:54 +0200
Subject: [PATCH] upgrading packages and kernel, manually tested only at this
 point

---
 roles/rke2/tasks/setup_host.yml | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/roles/rke2/tasks/setup_host.yml b/roles/rke2/tasks/setup_host.yml
index b8d3d36..8d11ceb 100644
--- a/roles/rke2/tasks/setup_host.yml
+++ b/roles/rke2/tasks/setup_host.yml
@@ -13,6 +13,13 @@
     /usr/sbin/pvresize -y -q /dev/vda2 
     /usr/sbin/lvresize -y -q -r -l +100%FREE /dev/mapper/*root 
 
+- name: Upgrade to latest kernel
+  shell: |
+    dnf upgrade -y 
+    dnf updateinfo list --security --available
+    dnf install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm --assumeyes
+    dnf --enablerepo=elrepo-kernel install kernel-ml --assumeyes
+    touch /.autorelabel
     
 - name: install RHEL packages
   dnf:
@@ -103,3 +110,10 @@
     path: /etc/rancher/rke2
     state: directory
     recurse: yes
+
+#- name: reboot (make sure SELinux is off)
+#  shell: |
+#    systemctl reboot
+- name: Reboot a slow machine that might have lots of updates to apply
+  ansible.builtin.reboot:
+    reboot_timeout: 3600
\ No newline at end of file
-- 
GitLab