Skip to content

Commit

Permalink
kernel: add 24.04 HWE support
Browse files Browse the repository at this point in the history
  • Loading branch information
saltydk committed Feb 15, 2025
1 parent 44e4d4b commit 1e408a4
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 5 deletions.
2 changes: 2 additions & 0 deletions roles/kernel/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ kernel_update_apt_fix: apt-get --fix-broken --yes install

kernel_update_apt_package_22: linux-generic-hwe-22.04

kernel_update_apt_package_24: linux-generic-hwe-24.04

kernel_install_hwe: false
16 changes: 13 additions & 3 deletions roles/kernel/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
ansible.builtin.include_tasks: "subtasks/02_cron.yml"

# Ubuntu 20.04 HWE Update
- name: Update Tasks
- name: Ubuntu 20.04 HWE Update Tasks
ansible.builtin.include_tasks: "subtasks/03_update_focal.yml"
when:
- (ansible_distribution == 'Ubuntu')
Expand All @@ -25,7 +25,7 @@
- kernel_install_hwe

# Ubuntu 22.04 HWE Update
- name: Update Tasks
- name: Ubuntu 22.04 Update Tasks
ansible.builtin.include_tasks: "subtasks/04_update_jammy.yml"
when:
- (ansible_distribution == 'Ubuntu')
Expand All @@ -34,8 +34,18 @@
- (not continuous_integration)
- kernel_install_hwe

# Ubuntu 24.04 HWE Update
- name: Ubuntu 24.04 Update Tasks
ansible.builtin.include_tasks: "subtasks/05_update_noble.yml"
when:
- (ansible_distribution == 'Ubuntu')
- (ansible_distribution_version is version('24.04', '=='))
- (ansible_kernel is version('6.11', '<'))
- (not continuous_integration)
- kernel_install_hwe

- name: Restart Tasks
ansible.builtin.include_tasks: "subtasks/05_restart.yml"
ansible.builtin.include_tasks: "subtasks/06_restart.yml"
when:
- reboot_is_necessary
- (not continuous_integration)
2 changes: 1 addition & 1 deletion roles/kernel/tasks/subtasks/03_update_focal.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#########################################################################
# Title: Saltbox: Kernel | Update Tasks #
# Title: Saltbox: Kernel | Focal Update Tasks #
# Author(s): desimaniac #
# URL: https://github.com/saltyorg/Saltbox #
# -- #
Expand Down
2 changes: 1 addition & 1 deletion roles/kernel/tasks/subtasks/04_update_jammy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#########################################################################
# Title: Saltbox: Kernel | Update Tasks #
# Title: Saltbox: Kernel | Jammy Update Tasks #
# Author(s): salty #
# URL: https://github.com/saltyorg/Saltbox #
# -- #
Expand Down
34 changes: 34 additions & 0 deletions roles/kernel/tasks/subtasks/05_update_noble.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#########################################################################
# Title: Saltbox: Kernel | Nobel Update Tasks #
# Author(s): salty #
# URL: https://github.com/saltyorg/Saltbox #
# -- #
#########################################################################
# GNU General Public License v3.0 #
#########################################################################
---
- name: Update | Update linux kernel
ansible.builtin.apt:
name: "{{ kernel_update_apt_package_24 }}"
update_cache: true
state: latest
register: r

- name: Update | Fix broken APT install
ansible.builtin.shell: "{{ kernel_update_apt_fix }}"
when: r.changed

- name: Update | Set 'reboot_is_necessary' variable
ansible.builtin.set_fact:
reboot_is_necessary: true
when: r.changed

- name: Update | Kernel was updated
ansible.builtin.debug:
msg: "Kernel was updated."
when: r.changed

- name: Update | Kernel was not updated
ansible.builtin.debug:
msg: "Kernel was not updated."
when: (not r.changed)
File renamed without changes.

0 comments on commit 1e408a4

Please sign in to comment.