[chef] Re: Stop multiple services


Chronological Thread 
  • From: Ranjib Dey < >
  • To: " " < >
  • Subject: [chef] Re: Stop multiple services
  • Date: Sun, 14 Sep 2014 01:49:25 -0700

instead of service "svc" it should be service svc , without quote.

why you are wrapping the service resources inside a ruby_block? You can puts the file reading bits in recipe directly (unless /root/svc is being populated during the converge time)

On Sun, Sep 14, 2014 at 1:45 AM, < " target="_blank"> > wrote:
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.

§