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
Mutiple 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
salt.states.kmod.
absent
(name, persist=False, comment=True, mods=None)¶Verify that the named kernel module is not loaded
/etc/modules
/etc/modules
rather than remove itA 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
2016.3.0 新版功能.
salt.states.kmod.
present
(name, persist=False, mods=None)¶Ensure that the specified kernel module is loaded
/etc/modules
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
2016.3.0 新版功能.