Skip to content

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

StateMeaning
presentThe named module is loaded; with persist: true (the default) a keystone-managed /etc/modules-load.d entry ensures it loads at boot.
absentThe 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

ParameterTypeRequiredDescription
persistboolWhether 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: present

Load for the current boot only

With persist disabled, no /etc/modules-load.d entry is written.

kernel_module:
  overlay:
    state: present
    persist: false

Ensure a module is unloaded and stays out at boot

kernel_module:
  pcspkr:
    state: absent

Notes

  • 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/modules comparisons and persist filenames stay stable.
  • Out of scope for v0.1: modprobe options / load-time module parameters, and /etc/modprobe.d blacklist management.