summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/resource/kernel_module.rb46
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/chef/resource/kernel_module.rb b/lib/chef/resource/kernel_module.rb
index 3dc879adf5..d25d512a51 100644
--- a/lib/chef/resource/kernel_module.rb
+++ b/lib/chef/resource/kernel_module.rb
@@ -15,6 +15,52 @@ class Chef
description "Use the kernel_module resource to manage kernel modules on Linux systems. This resource can load, unload, blacklist, disable, install, and uninstall modules."
introduced "14.3"
+ examples <<~DOC
+ Install and load a kernel module, and ensure it loads on reboot.
+ ```ruby
+ kernel_module 'loop'
+ ```
+ Install and load a kernel with a specific set of options, and ensure it loads on reboot. Consult kernel module
+ documentation for specific options that are supported.
+ ```ruby
+ kernel_module 'loop' do
+ options [
+ 'max_loop=4',
+ 'max_part=8'
+ ]
+ end
+ ```
+ Load a kernel module.
+ ```ruby
+ kernel_module 'loop' do
+ action :load
+ end
+ ```
+ Unload a kernel module and remove module config, so it doesn’t load on reboot.
+ ```ruby
+ kernel_module 'loop' do
+ action :uninstall
+ end
+ ```
+ Unload kernel module.
+ ```ruby
+ kernel_module 'loop' do
+ action :unload
+ end
+ ```
+ Blacklist a module from loading.
+ ```ruby
+ kernel_module 'loop' do
+ action :blacklist
+ end
+ ```
+ Disable a kernel module.
+ ```ruby
+ kernel_module 'loop' do
+ action :disable
+ end
+ ```
+ DOC
property :modname, String,
description: "An optional property to set the kernel module name if it differs from the resource block's name.",