The Kernel modules on a system can be managed cleanly with the kmod state module:
add_kvm:
kmod.present:
- name: kvm_amd
remove_beep:
kmod.absent:
- name: pcspkr
Multiple modules can be specified for both kmod.present and kmod.absent.
add_sound:
kmod.present:
- mods:
- snd_hda_codec_hdmi
- snd_hda_codec
- snd_hwdep
- snd_hda_core
- snd_pcm
- snd_timer
- snd
Verify that the named kernel module is not loaded
The name of the kernel module to verify is not loaded
Remove module from /etc/modules
(or
/etc/modules-load.d/salt_managed.conf
if the systemd
key is
present in Grains.
Comment out module in /etc/modules
rather than remove it
A list of modules to verify are unloaded. If this argument is used,
the name
argument, although still required, is not used, and
becomes a placeholder
New in version 2016.3.0.
Ensure that the specified kernel module is loaded
The name of the kernel module to verify is loaded
Also add module to /etc/modules
(or
/etc/modules-load.d/salt_managed.conf
if the systemd
key is
present in Grains.
A list of modules to verify are loaded. If this argument is used, the
name
argument, although still required, is not used, and becomes a
placeholder
New in version 2016.3.0.