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
/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
New in version 2016.3.0.
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
New in version 2016.3.0.
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/states/all/salt.states.kmod.html