refactor ♻️: Refactor kernel panic configuration with ansible.posix.sysctl for better management and readability
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 12s
Gitleaks Scan / gitleaks (push) Successful in 7s
Markdown Lint / markdown-lint (push) Successful in 4s

This refactoring involves updating the kernel panic configuration management to utilize the `ansible.posix.sysctl` module. This change enhances the clarity and maintainability of the code by providing a more structured approach to handling system settings.
This commit is contained in:
2026-02-15 08:36:22 +01:00
parent 059ea94842
commit 4ea7833055

View File

@@ -3,16 +3,12 @@
# Configure kernel panic behavior # Configure kernel panic behavior
# ------------------------------------------------- # -------------------------------------------------
- name: kernel | Configure kernel panic auto-reboot - name: kernel | Configure kernel panic auto-reboot
ansible.builtin.copy: ansible.posix.sysctl:
dest: /etc/sysctl.d/99-kernelpanic.conf name: "{{ item.key }}"
content: | value: "{{ item.value }}"
kernel.panic = 10 state: present
kernel.panic_on_oops = 1 sysctl_file: /etc/sysctl.d/99-kernelpanic.conf
owner: root reload: yes
group: root loop:
mode: '0644' - { key: 'kernel.panic', value: '10' }
- { key: 'kernel.panic_on_oops', value: '1' }
- name: kernel | Apply kernel panic settings
ansible.builtin.command:
cmd: sysctl -p /etc/sysctl.d/99-kernelpanic.conf
become: true