kernel_module
Manages a Linux kernel module: ensures it is loaded (or unloaded) and, by default, that a keystone-managed /etc/modules-load.d entry persists the choice across reboots. Idempotent: re-applying an unchanged declaration reports no change.
Category: System config
States
| State | Meaning |
|---|---|
present | The named module is loaded; with persist: true (the default) a keystone-managed /etc/modules-load.d entry ensures it loads at boot. |
absent | The named module is not loaded; with persist: true the keystone-managed modules-load entry is removed so a reboot does not bring it back. |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
persist | bool | Whether to manage a boot-load entry under /etc/modules-load.d. When false, only the live loaded/unloaded state is reconciled. Default: true. |
Examples
Load a module and persist it across reboots
The declaration name is the module name; dashes and underscores are both accepted.
kernel_module:
br_netfilter:
state: presentLoad for the current boot only
With persist disabled, no /etc/modules-load.d entry is written.
kernel_module:
overlay:
state: present
persist: falseEnsure a module is unloaded and stays out at boot
kernel_module:
pcspkr:
state: absentNotes
- Linux only — there is no kernel-module concept on other operating systems.
- Module names accept dashed (
br-netfilter) or underscored (br_netfilter) forms; dashes are normalised to underscores (the kernel’s internal form) so/proc/modulescomparisons and persist filenames stay stable. - Out of scope for v0.1: modprobe options / load-time module parameters, and
/etc/modprobe.dblacklist management.