summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Albertson <lance@osuosl.org>2019-09-16 11:32:16 -0700
committerLance Albertson <lance@osuosl.org>2019-11-21 10:53:58 -0800
commit54c16388b63e3a05cca2120d1bcfcc8c10326402 (patch)
treed546486698f5439620a40463cd54b5b9e88aba2f
parent5d7c6241802bc833954588dec25a04e294a87155 (diff)
downloadchef-54c16388b63e3a05cca2120d1bcfcc8c10326402.tar.gz
Add example documentation for kernel_module resource
Signed-off-by: Lance Albertson <lance@osuosl.org>
-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 4bf32cc7c4..b11d04faba 100644
--- a/lib/chef/resource/kernel_module.rb
+++ b/lib/chef/resource/kernel_module.rb
@@ -16,6 +16,52 @@ class Chef
description "Use the kernel_module resource to manage kernel modules on Linux systems. This resource can load, unload, blacklist, 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.",