Commit 9538001e authored by Maciej Delmanowski's avatar Maciej Delmanowski

Merge branch 'drybjed-kmod-load-modules'

parents f0b7ecb0 eac055e8
Pipeline #19634163 passed with stages
in 8 minutes and 35 seconds
......@@ -57,3 +57,16 @@
mode: '0644'
with_items: '{{ kmod__combined_load | parse_kv_items }}'
when: kmod__enabled|bool and item.name|d() and item.state|d('present') not in [ 'absent', 'ignore' ]
- name: Load missing kernel modules enabled at boot
modprobe:
name: '{{ item.name }}'
state: 'present'
with_items: '{{ kmod__combined_load | parse_kv_items }}'
register: kmod__register_load
when: kmod__enabled|bool and item.name|d() and item.state|d('present') not in [ 'config', 'absent', 'ignore' ] and
item.modules is undefined and item.name not in ansible_local.kmod.modules
- name: Update Ansible facts if modules were loaded
action: setup
when: kmod__register_load is changed
......@@ -169,9 +169,11 @@ kmod__load
----------
The ``kmod__*_load`` list variables can be used to specify which kernel modules
should be loaded at boot time. The configuration is stored in the
:file:`/etc/modules-load.d/` directory. Each list entry is a YAML dictionary
with specific parameters:
should be loaded at boot time. If a single module is specified, the role will
try to load it if it's currently not present in the kernel.
The configuration is stored in the :file:`/etc/modules-load.d/` directory. Each
list entry is a YAML dictionary with specific parameters:
``name``
Required. Name of the kernel module to manage. This parameter is used as
......@@ -198,6 +200,10 @@ with specific parameters:
------------- -------------------------------------------------------------
``absent`` The configuration of a given kernel module will be removed.
------------- -------------------------------------------------------------
``config`` Specified kernel module configuration is set in the
configuration file, but the role will not try to load the
missing module into the kernel.
------------- -------------------------------------------------------------
``ignore`` Configuration entries with this state will not be evaluated
by the role and won't be merged with other entries with the
same ``name`` parameter.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment