Commit b83d5c66 authored by Maciej Delmanowski's avatar Maciej Delmanowski

Merge branch 'drybjed-kmod-fixes'

parents 9538001e 697a6760
Pipeline #19655800 passed with stages
in 4 minutes and 1 second
......@@ -96,7 +96,7 @@ kmod__dependent_modules: []
# The variable that combines all lists of kernel module parameters and passes
# them to the role tasks.
kmod__combined_modules: '{{ kmod__default_modules
+ kmod__dependent_modules
+ lookup("flattened", kmod__dependent_modules, wantlist=True)
+ kmod__modules
+ kmod__group_modules
+ kmod__host_modules }}'
......@@ -140,7 +140,7 @@ kmod__dependent_load: []
#
# Variable which combines all of the kernel module load lists and passes them
# to the role tasks.
kmod__combined_load: '{{ kmod__dependent_load
kmod__combined_load: '{{ lookup("flattened", kmod__dependent_load, wantlist=True)
+ kmod__load
+ kmod__group_load
+ kmod__host_load }}'
......
......@@ -5,11 +5,15 @@
from __future__ import print_function
from json import loads, dumps
import kmodpy
try:
import kmodpy
kernel_modules = [x[0] for x in kmodpy.Kmod().list()]
except ImportError:
kernel_modules = []
output = loads('''{{ {"configured": True,
"enabled": kmod__enabled|bool} | to_nice_json }}''')
output['modules'] = [x[0] for x in kmodpy.Kmod().list()]
output['modules'] = kernel_modules
print(dumps(output, sort_keys=True, indent=4))
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