diff options
author | Tim Smith <tsmith@chef.io> | 2018-06-11 13:52:28 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-06-11 13:52:28 -0700 |
commit | 6e83d7ba4106414aa60114f7184bdf1c39357232 (patch) | |
tree | 433365b6941e2231cd03824a7634d74733075b2a | |
parent | 738a786f78ec4d31576b9f1edde3fd3870bdb104 (diff) | |
download | chef-6e83d7ba4106414aa60114f7184bdf1c39357232.tar.gz |
Don't use delcare_resource
Not needed anymore
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/chef/resource/kernel_module.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/chef/resource/kernel_module.rb b/lib/chef/resource/kernel_module.rb index 7b49bbb8fa..55ce9d080b 100644 --- a/lib/chef/resource/kernel_module.rb +++ b/lib/chef/resource/kernel_module.rb @@ -32,16 +32,16 @@ class Chef action :install do description "Load kernel module, and ensure it loads on reboot" - declare_resource(:directory, new_resource.load_dir) do + directory new_resource.load_dir do recursive true end - declare_resource(:file, "#{new_resource.load_dir}/#{new_resource.modname}.conf") do + file "#{new_resource.load_dir}/#{new_resource.modname}.conf" do content "#{new_resource.modname}\n" notifies :run, "execute[update initramfs]" end - declare_resource(:execute, "update initramfs") do + execute "update initramfs" do command initramfs_command action :nothing end @@ -52,17 +52,17 @@ class Chef action :uninstall do description "Unload a kernel module and remove module config, so it doesn't load on reboot." - declare_resource(:file, "#{new_resource.load_dir}/#{new_resource.modname}.conf") do + file "#{new_resource.load_dir}/#{new_resource.modname}.conf" do action :delete notifies :run, "execute[update initramfs]" end - declare_resource(:file, "#{new_resource.unload_dir}/blacklist_#{new_resource.modname}.conf") do + file "#{new_resource.unload_dir}/blacklist_#{new_resource.modname}.conf" do action :delete notifies :run, "execute[update initramfs]" end - declare_resource(:execute, "update initramfs") do + execute "update initramfs" do command initramfs_command action :nothing end @@ -73,12 +73,12 @@ class Chef action :blacklist do description "Blacklist a kernel module." - declare_resource(:file, "#{new_resource.unload_dir}/blacklist_#{new_resource.modname}.conf") do + file "#{new_resource.unload_dir}/blacklist_#{new_resource.modname}.conf" do content "blacklist #{new_resource.modname}" notifies :run, "execute[update initramfs]" end - declare_resource(:execute, "update initramfs") do + execute "update initramfs" do command initramfs_command action :nothing end |