[chef] Re: Re: Re: Re: Re: Re: Writing a Start Handler


Chronological Thread 
  • From: Douglas Garstang < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: Re: Writing a Start Handler
  • Date: Tue, 19 Aug 2014 10:40:06 -0700

Ranjib,

You said that using chef_handler is not an idea solution. If we look at the alternatives, I still don't understand where to put the files. You mentioned a require statement. There's no require statement in the client.rb file, so I don't know where that's supposed to go. If the files are present on the AMI before chef runs, I don't know where to place these files. Documentation would be immensely helpful.

Douglas.



On Tue, Aug 19, 2014 at 10:36 AM, Ranjib Dey < " target="_blank"> > wrote:
im not saying, you are interpreting it like that. This is fairly advance usage, as you are re-configuring chef using chef. there are clean work around, if you read a bit of ruby or chef apis. Unlike puppet, chef is free form (in fact its a trait coming from ruby) and can be used/abused in myriad of ways. the assumption is you know best what you want to do. for example if you have kickstart or spacewalk or cobbler in place, this can be done on their side as well. For cloud based deployments, you can use images with baked in chef configs, for others you can also use custom bootstrap scripts. So, there are more than one clean way to do this, but chef also allows it do it via chef (and there are reasons to support that as well).


On Tue, Aug 19, 2014 at 10:24 AM, Douglas Garstang < " target="_blank"> > wrote:
So it sounds like your basically saying this is a mess.


On Tue, Aug 19, 2014 at 10:22 AM, Ranjib Dey < " target="_blank"> > wrote:
by chef itself, generally. chef_handler cookbook provides a nifty lwrp to do this as well. one pattern i have seen is to drop the file using cookbook_file during compile time, followed by chef_handler lwrp invocation (which will reconfigure chef internally). Its not a clean solution.

I prefer to break down node provisioning in stages (lvm, chef client configs, chef_gems in one , rest of the stuff in another).

cheers
ranjib


On Tue, Aug 19, 2014 at 10:16 AM, Douglas Garstang < " target="_blank"> > wrote:
Ranjib,

How does it get deployed though? Via chef or via other means? What require are you referring to? There is no require in the client.rb file.

Doug.



On Tue, Aug 19, 2014 at 10:10 AM, Ranjib Dey < " target="_blank"> > wrote:
can be anywhere in you system. if its in arbitrary path, you have to supply the entire path (without .rb extension) in require, if its anywhere in $LOAD_PATH, then just the file name (without the .rb extension).

require 'foo' # if foo.rb is anywhere in $LOAD_PATH
require '/home/doug/foo' # when /home/doug is outside $LOAD_PATH

cheers
ranjib


On Tue, Aug 19, 2014 at 9:56 AM, Douglas Garstang < " target="_blank"> > wrote:
I'm trying to write a start handler. I've managed to get

start_handlers << Chef::Reporting::StartHandler.new()

into the client.rb file. Obviously, I need to change the details. Now, I'm reading http://docs.getchef.com/handlers.html and under the 'Reporting' section it talks about how to install the handler, but it doesn't say where the start_handler.rb file goes.

Does it go in a cookbook? This would seem to be a problem to me as the handler needs to be deployed before chef runs.

Doug




--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: " target="_blank">
Cell: +1-805-340-5627




--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: " target="_blank">
Cell: +1-805-340-5627




--
Regards,

Douglas Garstang
http://www.linkedin.com/in/garstang
Email: ">
Cell: +1-805-340-5627



Archive powered by MHonArc 2.6.16.

§