[chef] Re: Re: How to include recipe inside the Libraries folder file


Chronological Thread 
  • From: Andrew Gross < >
  • To: chef < >
  • Subject: [chef] Re: Re: How to include recipe inside the Libraries folder file
  • Date: Fri, 28 Jun 2013 10:12:02 -0400

Library files are not meant for including other recipes.  My normal pattern is to have a default.rb recipe (or lib.rb) that I should be included by default if I need to force other recipes to be included.  If you are truly crafty, ruby would allow you to mess around with recipes in libraries (since it is all Ruby code), but it will probably be very hard and unmaintainable.

Andrew


On Fri, Jun 28, 2013 at 8:38 AM, Cassiano Leal < " target="_blank"> > wrote:
I don’t think you can but more seasoned Chefs here will be able to confirm or deny.

My understanding is that the libraries/ directory is there to hold Ruby code that will support your recipes, not the other way around.

You can include a recipe in another recipe via the include_recipe resource, though.

- cassiano

On Friday, June 28, 2013 at 04:56, Sachin Sagar Rai wrote:


I'm writing an LWRP.

I'm in the situation that I've a file at libraries/ folder.

In this file, how can I include the recipe that installs some pkgs and gems.

include_recipe 'foo' doesnt seem to work.

How can I include that recipe in the libraries/bar.rb file?


-------------------------------------------
@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com
Sent with Sparrow






Archive powered by MHonArc 2.6.16.

§