[chef] Re: Re: Re: Re: Re: Re: yum::epel problems in wrapped cookbook


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: Re: yum::epel problems in wrapped cookbook
  • Date: Mon, 17 Jun 2013 09:24:59 -0700


On Sunday, June 16, 2013 at 7:25 PM, Jeffrey Jones wrote:

Hello Steven

On 15/06/13 06:22, Steven Danna wrote:
On 6/14/13 7:57 AM, Julian C. Dunn wrote:
Hey Jeffrey: I don't see your recipe code anywhere but judging from the
gist you have something like this:

connector::default has include_recipe "torquebox-web-server"
torquebox-web-server::default has include_recipe "yum::epel"

Is "yum" anywhere in your metadata for any of those cookbooks?

Even I'm not entirely sure whether include_recipe also loads attributes
from the dependent cookbook...
I have added the debug output after adding the "include_attribute" section.
It looks like the old error has been fixed but a new error has appeared.

"[2013-06-17T02:12:46+00:00] FATAL: NameError: Cannot find a resource
for yum_key on centos version 6.4"

I am guessing that the attributes/epel.rb file is being executed by the
selection logic inside the file is failing for some reason?

for full debug output)

Cheers

Jeff
As Julian said, the key here is that you need to specify the dependency between your cookbook and the yum cookbook in the cookbook's metadata:

http://docs.opscode.com/essentials_cookbook_metadata.html

Chef 11 uses the metadata to figure out a sane order for cookbook loading. If a cookbook doesn't appear in either the run list or dependencies of a cookbook in the run_list, it will not get loaded correctly. As you've seen, you can work around this a little bit with include_recipe and include_attribute, but you won't load libraries, resource definitions, or LWRPs. Adding the dependency in the metadata is the only way to make those work.

-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§