[chef] Re: Re: making a library global?


Chronological Thread 
  • From: Paul Choi < >
  • To:
  • Subject: [chef] Re: Re: making a library global?
  • Date: Fri, 16 Jul 2010 16:00:59 -0700
  • Organization: Plaxo, Inc.

Thanks, Josh!

So because everything is converged when a client runs on a node, a library is automatically available to any cookbook in the whole node. Great, good to know!

I think I'll just create a "libraries" cookbook and modify the metadata to include as needed. It's kinda like having my own lib directory, in a way.

-Paul

On 7/16/10 3:42 PM, Joshua Timberman wrote:
Hello!

On Jul 16, 2010, at 4:38 PM, Paul Choi wrote:

The wiki says:
"Any libraries you include in a Cookbook will automatically be required, and 
available within all your Recipes, Attribute Files and Definitions."

Is there a way to make a library global so that it's available to all 
cookbooks?
Two ways.

1. Include the cookbook in the run list of the node, or a role on the node. 
It doesn't have to do anything - the default.rb can be blank. E.g.,

{ "run_list": [ "recipe[your_library_cookbook]" ] }

That will cause it to be downloaded, and its libraries loaded on the node.

2. Put the cookbook in the metadata of any cookbooks you want to use the 
library in. E.g.,

depends "your_library_cookbook"

In metadata.rb of another cookbook where you want to use the library.





Archive powered by MHonArc 2.6.16.

§