Calling the LWRP from the Exception Handler
- by Sarah Haskins
Is it possible to call out to a Provider (LWRP) from a Chef Exception Handler? I think my Provider is out of scope, but I don't know if what I am trying to do is possible? or advisable?
Here is my provider code (cookbooks/config/provider/signal.rb):
action :failure do
Chef::Log.info("Yeah success")
end
Here is my exception handler code (exception_handler/handlers/exceptionHandler.rb):
require 'chef/handler'
config_signal "signal" do
action :nothing
end
class Chef
class Handler
class LogCollector < Chef::Handler
notifies :failure, resources(:config_signal => signal)
end
end
end
Also, if anyone has a good recommendation for general reading about scope in the context of Chef I'd appreciate it.