Reputation: 28342
I'm trying to extend Bash
resource, so that when I invoke shm_wbash
, the command's output is placed in a log file as it runs. Since I don't want to copy all the available parameters to LWRP resource definition, I've tried to extend the original chef Bash resource like this (I'll be omitting the actual payload since that doesn't matter here):
class Chef
class Resource
class WBash < Resource::Bash
def initialize(name, run_context=nil)
super
puts 123
end
end
end
end
I've put that to cookbooks/shm/libraries/wbash.rb
and when I try to run it, I get No resource or method named 'shm_wbash' for
Chef::Recipe "test"'`. How do I fix this?
Upvotes: 1
Views: 719
Reputation: 964
Use w_bash
This is what chef is converting the class name to for use in the DSL.
Upvotes: 1