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.
15 lines
462 B
YAML
15 lines
462 B
YAML
---
|
|
# -------------------------------------------------
|
|
# Configure kernel panic behavior
|
|
# -------------------------------------------------
|
|
- name: kernel | Configure kernel panic auto-reboot
|
|
ansible.posix.sysctl:
|
|
name: "{{ item.key }}"
|
|
value: "{{ item.value }}"
|
|
state: present
|
|
sysctl_file: /etc/sysctl.d/99-kernelpanic.conf
|
|
reload: yes
|
|
loop:
|
|
- { key: 'kernel.panic', value: '10' }
|
|
- { key: 'kernel.panic_on_oops', value: '1' }
|