Use the provider attribute if the service resource and your declaration should use the var without quotes or with #{svc}
See http://docs.getchef.com/resource_service.html for the service resource and provider attribute
Envoyé à partir de mon smartphone Sony Xperia™
If it is inside a recipe you don't have to require the service provider, it will guess it.
If you really want to enforce it, there's a provider attribute to the service resource.For the error message, require take a path to a file without the extension, here it should be require "chef/provider/service/init/redhat"
Envoyé à partir de mon smartphone Sony Xperia™
---- " target="_blank"> a écrit ----
I have multiple services that I need to stop , my code is as below ,
ruby_block "stopsvc" do
block do
services = File.readlines("/root/svc")
services.each do |svc|
require
Chef::Provider::Service::Init::Redhat
service "svc" do
action [ :stop, :disable]
end
end
end
end
"can't convert Class into String" is the error I am seeing . Please point what
I need ,
Archive powered by MHonArc 2.6.16.