Module Expr Str FunctionDef arguments args defaults body Expr Str Return CompareIn Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str BinOpAdd BinOpAdd Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If UnaryOpNot Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign NameStore ListLoad NameLoad Assign NameStore Dict Str Str Str Str NameLoad NameLoad Dict Str Assign NameStore Call SubscriptLoad NameLoad Index Str If NameLoad body Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad Assign NameStore Call NameLoad BinOpBitAnd Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore Call NameLoad BinOpBitAnd Call NameLoad NameLoad Call NameLoad NameLoad If CompareEq Call NameLoad NameLoad Num body Assign NameStore Call AttributeLoad Str attr SubscriptLoad NameLoad Index Num Expr Call NameLoad NameLoad NameLoad orelse If CompareGt Call NameLoad NameLoad Num body Assign NameStore Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad Expr Call NameLoad NameLoad NameLoad If CompareEq Call NameLoad NameLoad Call NameLoad NameLoad body Return NameLoad Assign NameStore Call NameLoad BinOpSub Call NameLoad NameLoad Call NameLoad NameLoad If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str NameLoad If Call NameLoad SubscriptLoad NameLoad Index Str body AugAssignAdd SubscriptStore NameLoad Index Str Str If CompareEq Call NameLoad NameLoad Num body Assign NameStore Call AttributeLoad Str attr SubscriptLoad NameLoad Index Num orelse Assign NameStore Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad Expr Call NameLoad NameLoad NameLoad Return NameLoad Assign NameStore Call NameLoad BinOpSub Call NameLoad NameLoad Call NameLoad Call SubscriptLoad NameLoad Index Str If NameLoad body If CompareEq Call NameLoad NameLoad Num body Assign NameStore Call AttributeLoad Str attr SubscriptLoad NameLoad Index Num orelse Assign NameStore Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad Expr Call NameLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Call NameLoad BinOpSub Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore Dict Str Str Str ListLoad ListLoad ListLoad For NameStore NameLoad body Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body If CompareGt Call NameLoad NameLoad Num body For NameStore NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index Str Index NameLoad Str Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr ListLoad NameLoad NameLoad If CompareEq Call NameLoad SubscriptLoad NameLoad Index Str Num body Expr Call NameLoad NameLoad Call AttributeLoad Str attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Num orelse If CompareGt Call NameLoad SubscriptLoad NameLoad Index Str Num body Expr Call NameLoad NameLoad Call AttributeLoad Str attr Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str If CompareEq Call NameLoad SubscriptLoad NameLoad Index Str Num body Expr Call NameLoad NameLoad Call AttributeLoad Str attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Num If CompareGt Call NameLoad SubscriptLoad NameLoad Index Str Num body Expr Call NameLoad NameLoad Call AttributeLoad Str attr Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str If Call NameLoad SubscriptLoad NameLoad Index Str body For TupleStore NameStore NameStore SubscriptLoad NameLoad Index Str body Expr Call NameLoad NameLoad Call AttributeLoad Str attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str If UnaryOpNot Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign NameStore ListLoad NameLoad Assign NameStore Dict Str Str Str Str NameLoad NameLoad Dict Str Assign NameStore Call SubscriptLoad NameLoad Index Str If NameLoad body Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad Assign NameStore Call NameLoad BinOpBitOr Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore Call NameLoad BinOpBitAnd Call NameLoad NameLoad Call NameLoad NameLoad If NameLoad body If SubscriptLoad NameLoad Index Str body Assign SubscriptStore NameLoad Index Str NameLoad If CompareEq Call NameLoad NameLoad Num body Expr Call NameLoad NameLoad Call AttributeLoad Str attr SubscriptLoad NameLoad Index Num orelse If CompareGt Call NameLoad NameLoad Num body Expr Call NameLoad NameLoad Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad Return NameLoad Assign NameStore Dict Str Str Str ListLoad ListLoad ListLoad For NameStore NameLoad body Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body If CompareGt Call NameLoad NameLoad Num body For NameStore NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index Str Index NameLoad Str Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad orelse Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr ListLoad NameLoad NameLoad If CompareEq Call NameLoad SubscriptLoad NameLoad Index Str Num body Expr Call NameLoad NameLoad Call AttributeLoad Str attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Num orelse If CompareGt Call NameLoad SubscriptLoad NameLoad Index Str Num body Expr Call NameLoad NameLoad Call AttributeLoad Str attr Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str If CompareEq Call NameLoad SubscriptLoad NameLoad Index Str Num body Expr Call NameLoad NameLoad Call AttributeLoad Str attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Num If CompareGt Call NameLoad SubscriptLoad NameLoad Index Str Num body Expr Call NameLoad NameLoad Call AttributeLoad Str attr Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str If Call NameLoad SubscriptLoad NameLoad Index Str body For TupleStore NameStore NameStore SubscriptLoad NameLoad Index Str body Expr Call NameLoad NameLoad Call AttributeLoad Str attr NameLoad NameLoad Return NameLoad orelse If CompareEq Call NameLoad NameLoad Num body Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr SubscriptLoad NameLoad Index Num orelse Assign SubscriptStore NameLoad Index Str Call AttributeLoad Str attr Call AttributeLoad Str attr NameLoad Return NameLoad decorator_list
N/A N/A 
Loading and unloading of kernel modules
=======================================

The Kernel modules on a system can be managed cleanly with the kmod state
module:

.. code-block:: yaml

    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.

.. code-block:: yaml

    add_sound:
      kmod.present:
        - mods:
          - snd_hda_codec_hdmi
          - snd_hda_codec
          - snd_hwdep
          - snd_hda_core
          - snd_pcm
          - snd_timer
          - snd
 __virtual__ N/A N/A N/A N/A N/A 
    Only load if the kmod module is available in __salt__
     N/A N/A kmod.available __salt__ N/A _append_comment N/A N/A ret comment N/A N/A N/A 
    append ``comment`` to ``ret['comment']``
     N/A N/A len N/A ret N/A comment N/A N/A N/A ret N/A comment N/A N/A N/A N/A N/A ret N/A comment rstrip comment N/A N/A N/A ret N/A comment comment N/A ret N/A present N/A N/A name persist mods N/A False None N/A N/A 
    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``

    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

        .. versionadded:: 2016.3.0
     N/A N/A N/A isinstance mods N/A list tuple N/A N/A mods N/A name N/A ret N/A name result changes comment name True N/A N/A loaded_mods N/A N/A __salt__ N/A kmod.mod_list N/A persist N/A N/A persist_mods N/A N/A __salt__ N/A kmod.mod_list True N/A loaded_mods N/A list N/A N/A set loaded_mods N/A set persist_mods N/A already_loaded N/A list N/A N/A set loaded_mods N/A set mods N/A N/A N/A len already_loaded 1 N/A N/A comment N/A N/A Kernel module {0} is already present format N/A already_loaded N/A 0 N/A N/A _append_comment ret comment N/A N/A N/A N/A len already_loaded 1 N/A N/A comment N/A N/A Kernel modules {0} are already present format N/A N/A ,  join already_loaded N/A N/A _append_comment ret comment N/A N/A N/A len already_loaded N/A len mods N/A N/A ret N/A not_loaded N/A list N/A N/A set mods N/A set already_loaded N/A N/A __opts__ N/A test N/A N/A N/A ret N/A result None N/A N/A len N/A ret N/A comment N/A N/A N/A ret N/A comment N/A N/A N/A len not_loaded 1 N/A N/A comment N/A N/A Kernel module {0} is set to be loaded format N/A not_loaded N/A 0 N/A N/A comment N/A N/A Kernel modules {0} are set to be loaded format N/A N/A ,  join not_loaded N/A N/A _append_comment ret comment N/A ret N/A unavailable N/A list N/A N/A set not_loaded N/A set N/A N/A __salt__ N/A kmod.available N/A unavailable N/A N/A N/A N/A len unavailable 1 N/A N/A comment N/A N/A Kernel module {0} is unavailable format N/A unavailable N/A 0 N/A N/A comment N/A N/A Kernel modules {0} are unavailable format N/A N/A ,  join unavailable N/A N/A _append_comment ret comment N/A N/A ret N/A result False N/A available N/A list N/A N/A set not_loaded N/A set unavailable N/A loaded N/A yes no failed N/A N/A N/A N/A mod available N/A N/A load_result N/A N/A __salt__ N/A kmod.load mod persist N/A N/A isinstance load_result N/A list tuple N/A N/A N/A N/A len load_result 0 N/A N/A module load_result N/A N/A N/A N/A ret N/A changes N/A module loaded N/A N/A N/A N/A loaded N/A yes append mod N/A N/A N/A ret N/A result False N/A N/A N/A N/A loaded N/A no append mod N/A N/A N/A ret N/A result False N/A N/A N/A N/A loaded N/A failed append N/A mod load_result N/A N/A N/A len N/A loaded N/A yes 1 N/A N/A N/A _append_comment ret N/A N/A Loaded kernel module {0} format N/A N/A loaded N/A yes N/A 0 N/A N/A N/A N/A len N/A loaded N/A yes 1 N/A N/A N/A _append_comment ret N/A N/A Loaded kernel modules {0} format N/A N/A ,  join N/A loaded N/A yes N/A N/A N/A len N/A loaded N/A no 1 N/A N/A N/A _append_comment ret N/A N/A Failed to load kernel module {0} format N/A N/A loaded N/A no N/A 0 N/A N/A N/A len N/A loaded N/A no 1 N/A N/A N/A _append_comment ret N/A N/A Failed to load kernel modules {0} format N/A N/A ,  join N/A loaded N/A no N/A N/A len N/A loaded N/A failed N/A N/A N/A mod msg N/A loaded N/A failed N/A N/A N/A _append_comment ret N/A N/A Failed to load kernel module {0}: {1} format mod msg N/A ret N/A absent N/A N/A name persist comment mods N/A False True None N/A N/A 
    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``

    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

        .. versionadded:: 2016.3.0
     N/A N/A N/A isinstance mods N/A list tuple N/A N/A mods N/A name N/A ret N/A name result changes comment name True N/A N/A loaded_mods N/A N/A __salt__ N/A kmod.mod_list N/A persist N/A N/A persist_mods N/A N/A __salt__ N/A kmod.mod_list True N/A loaded_mods N/A list N/A N/A set loaded_mods N/A set persist_mods N/A to_unload N/A list N/A N/A set mods N/A set loaded_mods N/A to_unload N/A N/A N/A __opts__ N/A test N/A N/A N/A ret N/A result None N/A N/A N/A len to_unload 1 N/A N/A N/A _append_comment ret N/A N/A Kernel module {0} is set to be removed format N/A to_unload N/A 0 N/A N/A N/A N/A len to_unload 1 N/A N/A N/A _append_comment ret N/A N/A Kernel modules {0} are set to be removed format N/A N/A ,  join to_unload N/A ret N/A unloaded N/A yes no failed N/A N/A N/A N/A mod to_unload N/A N/A unload_result N/A N/A __salt__ N/A kmod.remove mod persist comment N/A N/A isinstance unload_result N/A list tuple N/A N/A N/A N/A len unload_result 0 N/A N/A module unload_result N/A N/A N/A N/A ret N/A changes N/A module removed N/A N/A N/A N/A unloaded N/A yes append mod N/A N/A N/A ret N/A result False N/A N/A N/A N/A unloaded N/A no append mod N/A N/A N/A ret N/A result False N/A N/A N/A N/A unloaded N/A failed append N/A mod unload_result N/A N/A N/A len N/A unloaded N/A yes 1 N/A N/A N/A _append_comment ret N/A N/A Removed kernel module {0} format N/A N/A unloaded N/A yes N/A 0 N/A N/A N/A N/A len N/A unloaded N/A yes 1 N/A N/A N/A _append_comment ret N/A N/A Removed kernel modules {0} format N/A N/A ,  join N/A unloaded N/A yes N/A N/A N/A len N/A unloaded N/A no 1 N/A N/A N/A _append_comment ret N/A N/A Failed to remove kernel module {0} format N/A N/A unloaded N/A no N/A 0 N/A N/A N/A len N/A unloaded N/A no 1 N/A N/A N/A _append_comment ret N/A N/A Failed to remove kernel modules {0} format N/A N/A ,  join N/A unloaded N/A no N/A N/A len N/A unloaded N/A failed N/A N/A N/A mod msg N/A unloaded N/A failed N/A N/A N/A _append_comment ret N/A N/A Failed to remove kernel module {0}: {1} format mod msg N/A ret N/A N/A N/A N/A len mods 1 N/A N/A N/A ret N/A comment N/A N/A Kernel module {0} is already removed format N/A mods N/A 0 N/A N/A N/A ret N/A comment N/A N/A Kernel modules {0} are already removed format N/A N/A ,  join mods N/A ret N/A