[chef] Re: Re: What's a cookbook name?


Chronological Thread 
  • From: Russell Bateman < >
  • To:
  • Subject: [chef] Re: Re: What's a cookbook name?
  • Date: Thu, 27 Jun 2013 10:17:25 -0600

Brian,

I suppose this helps. What I've learned is that  I should have done this (which works):
~/dev/chef-repos $ knife node run_list add uas-dev-app01 'recipe[tomcat6]'

and left out the chef-repos:: qualification of the recipe name entirely. This is fine; I was just trying to follow the examples I'd seen very literally which  used the more exact qualification.

Thanks,

Russ



On 6/26/2013 3:45 PM, Brian Hatfield wrote:
" type="cite">
In the above example, tomcat6 is the name of your cookbook. Specifying a recipe like 'recipe[tomcat6]' is equivalent to 'recipe[tomcat6::default]', which matches chef-repos/cookbooks/tomcat6/recipes/default.rb.

Hope that helps.


On Wed, Jun 26, 2013 at 5:27 PM, Russell Bateman < " target="_blank"> > wrote:
I'm discovering that, as I have recipes in subdirectory named cookbook, and have put those recipes up to my Chef server,
~/dev/chef-repos $ knife node run_list add uas-dev-app01 'role[application-node]'
run_list:  [role[application-node]]
~/dev/chef-repos $ knife node run_list add uas-dev-app01 'recipe[chef-repos::tomcat6]'
run_list:
    role[application-node]
    recipe[chef-repos::tomcat6]

nevertheless they aren't useful to me when, on each of my nodes, I execute
chef-client. I used "chef-repos" because of examples I saw Googling.

I get this
:
...
================================================================================
Error Resolving Cookbooks for Run List:
================================================================================

Missing Cookbooks:
------------------
The following cookbooks are required by the client but don't exist on the server:
* chef-repos
...

which clearly shows that, while the Chef server web UI lists the recipes I need, they're referenced by a cookbook the server has no knowledge of. I cannot figure out how, using knife, to tell it. This is pretty confusing.

At my development host (from which I'm administering all of this), I see:
chef-repos
├── .chef
├── cookbooks
│   ├── apt
│   ├── mongodb
│   └── tomcat6
├── nodes
── roles

Based on the error above, I am induced to think that chef-repos is the name of my cookbook:
~/uas/chef-repos $ knife cookbook show chef-repos
ERROR: The object you are looking for could not be found
Response: Cannot find a cookbook named chef-repos
But, it's not. And sometimes in Chef, I can't tell the difference, especially when using knife cookbook, what the difference between a cookbook and a recipe is.

I'd like to know what to tell my server so that when I attempt to get a node up with chef-client, it knows what
chef-repos::tomcat6 is and that this recipe is the tomcat6 recipe sitting in Chef Server UI -> Cookbooks.

Many thanks.







Archive powered by MHonArc 2.6.16.

§