community.general.modprobe module – Load or unload kernel modules
Note
This module is part of the community.general collection (version 9.5.1).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.modprobe
.
Synopsis
Load or unload kernel modules.
Parameters
Parameter |
Comments |
---|---|
Name of kernel module to manage. |
|
Modules parameters. Default: |
|
Persistency between reboots for configured module. This option creates files in If If If Note that it is usually a better idea to rely on the automatic module loading by PCI IDs, USB IDs, DMI IDs or similar triggers encoded in the kernel modules themselves instead of configuration like this. In fact, most modern kernel modules are prepared for automatic loading already. Note: This option works only with distributions that use Choices:
|
|
Whether the module should be present or absent. Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Add the 802.1q module
community.general.modprobe:
name: 8021q
state: present
- name: Add the dummy module
community.general.modprobe:
name: dummy
state: present
params: 'numdummies=2'
- name: Add the dummy module and make sure it is loaded after reboots
community.general.modprobe:
name: dummy
state: present
params: 'numdummies=2'
persistent: present