[chef] Re: Stop multiple services


Chronological Thread 
  • From: Tensibai Zhaoying < >
  • To:
  • Subject: [chef] Re: Stop multiple services
  • Date: Sun, 14 Sep 2014 10:52:59 +0200

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™



---- 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.

§