[chef] How to generate metadata.json


Chronological Thread 
  • From: Paul Choi < >
  • To:
  • Subject: [chef] How to generate metadata.json
  • Date: Thu, 20 May 2010 17:11:43 -0700
  • Organization: Plaxo, Inc.

Hello,

I'm getting the following error:
[Thu, 20 May 2010 17:07:17 -0700] FATAL: Cannot find a cookbook named base; did you forget to add metadata to a cookbook? (http://wiki.opscode.com/display/chef/Metadata)

The client tries to execute a recipe as defined in the role's run_list. "base" cookbook does not have a metadata.json.
There is metadata.rb, which was created with "rake new_cookbook COOKBOOK=base".

metadata.rb looks like this:
maintainer       "Plaxo"
maintainer_email 
" "
license          "All rights reserved"
description      "Installs/Configures base"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version          "0.1"

%w{ redhat centos }.each do |os|
  supports os
end

"rake metadata" does not seem to do anything.
"rake metadata --trace" shows:

 chef]$ rake metadata --trace
(in /srv/chef)
** Invoke metadata (first_time)
** Invoke /srv/chef/site-cookbooks/sudo/metadata.json (first_time, not_needed)
** Invoke /srv/chef/site-cookbooks/sudo/metadata.rb (first_time, not_needed)
** Invoke /srv/chef/cookbooks/grub/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/grub/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/grub/metadata.json
** Invoke /srv/chef/cookbooks/chef_client/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/chef_client/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/chef_client/metadata.json
** Invoke /srv/chef/cookbooks/base/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/base/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/base/metadata.json
** Invoke /srv/chef/cookbooks/setupcore/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/setupcore/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/setupcore/metadata.json
** Invoke /srv/chef/cookbooks/yum/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/yum/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/yum/metadata.json
** Invoke /srv/chef/cookbooks/screen/metadata.json (first_time, not_needed)
** Invoke /srv/chef/cookbooks/screen/metadata.rb (first_time, not_needed)
** Invoke /srv/chef/cookbooks/perforce/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/perforce/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/perforce/metadata.json
** Invoke /srv/chef/cookbooks/daemontools/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/daemontools/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/daemontools/metadata.json
** Invoke /srv/chef/cookbooks/sudo/metadata.json (first_time, not_needed)
** Invoke /srv/chef/cookbooks/sudo/metadata.rb (first_time, not_needed)
** Invoke /srv/chef/cookbooks/setup_service/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/setup_service/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/setup_service/metadata.json
** Invoke /srv/chef/cookbooks/samba/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/samba/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/samba/metadata.json
** Invoke /srv/chef/cookbooks/dns/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/dns/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/dns/metadata.json
** Invoke /srv/chef/cookbooks/var_plaxo_dirs/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/var_plaxo_dirs/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/var_plaxo_dirs/metadata.json
** Invoke /srv/chef/cookbooks/sdev/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/sdev/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/sdev/metadata.json
** Invoke /srv/chef/cookbooks/postfix/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/postfix/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/postfix/metadata.json
** Invoke /srv/chef/cookbooks/ntp/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/ntp/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/ntp/metadata.json
** Invoke /srv/chef/cookbooks/sysctl/metadata.json (first_time)
** Invoke /srv/chef/cookbooks/sysctl/metadata.rb (first_time, not_needed)
** Execute /srv/chef/cookbooks/sysctl/metadata.json
** Execute metadata

 chef]$

But in the cookbooks that I created, metadata.json does not exist, even if --trace says rake tries to invoke it.

With simple recipes it seems to work fine without a metadata.json. Is it because some of my recipes have "include_recipe" dependency chains?

I'm kinda stuck, any ideas? Thanks for your help.

-Paul Choi



Archive powered by MHonArc 2.6.16.

§