From 059ea94842ab35a5d3b52c51fb0d54c61ef1394b Mon Sep 17 00:00:00 2001 From: Jose Date: Sun, 15 Feb 2026 08:30:32 +0100 Subject: [PATCH] =?UTF-8?q?feat=20=E2=9C=A8:=20Add=20task=20to=20configure?= =?UTF-8?q?=20kernel=20panic=20behavior=20and=20auto-reboot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit introduces two new tasks in the `kernel.yml` file: one to configure the kernel panic behavior and another for enabling automatic reboot on kernel panic. These enhancements improve system reliability by ensuring that the system can recover from critical errors more effectively. --- tasks/kernel.yml | 18 ++++++++++++++++++ tasks/main.yml | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 tasks/kernel.yml diff --git a/tasks/kernel.yml b/tasks/kernel.yml new file mode 100644 index 0000000..d8a23c5 --- /dev/null +++ b/tasks/kernel.yml @@ -0,0 +1,18 @@ +--- +# ------------------------------------------------- +# Configure kernel panic behavior +# ------------------------------------------------- +- name: kernel | Configure kernel panic auto-reboot + ansible.builtin.copy: + dest: /etc/sysctl.d/99-kernelpanic.conf + content: | + kernel.panic = 10 + kernel.panic_on_oops = 1 + owner: root + group: root + mode: '0644' + +- name: kernel | Apply kernel panic settings + ansible.builtin.command: + cmd: sysctl -p /etc/sysctl.d/99-kernelpanic.conf + become: true diff --git a/tasks/main.yml b/tasks/main.yml index b00e094..3793255 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -36,3 +36,6 @@ - name: Install powertop, auto-tune, and make it persistent ansible.builtin.import_tasks: powertop.yml + +- name: kernel panic auto-reboot + ansible.builtin.import_tasks: kernel.yml