# salt.states.kmod

## Loading and unloading of kernel modules

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

salt.states.kmod.absent(name, persist=False, comment=True, mods=None)

  Verify that the named kernel module is not loaded

  name

    The name of the kernel module to verify is not loaded

  persist

    Remove module from `/etc/modules` (or `/etc/modules-load.d/salt_managed.conf` if the `systemd` key is present in Grains.

  comment

    Comment out module in `/etc/modules` rather than remove it

  mods

    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

    Added in version 2016.3.0.

salt.states.kmod.present(name, persist=False, mods=None)

  Ensure that the specified kernel module is loaded

  name

    The name of the kernel module to verify is loaded

  persist

    Also add module to `/etc/modules` (or `/etc/modules-load.d/salt_managed.conf` if the `systemd` key is present in Grains.

  mods

    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

    Added in version 2016.3.0.