[chef] Don't require to upload cookbooks not actually being used


Chronological Thread 
  • From: Anton Koldaev < >
  • To:
  • Subject: [chef] Don't require to upload cookbooks not actually being used
  • Date: Tue, 9 Sep 2014 14:28:06 +0400

Let's look at lita cookbook:

`grep depends metadata.rb`:
depends 'apt'
depends 'build-essential'
depends 'ruby-ng', '~> 0.1.1'
depends 'redis2', '~> 0.5.0'

However there is an option not to use ruby-ng and redis2 cookbooks, which is really useful since there are plenty of different 'ruby' and 'redis' cookbooks and cookbook developer should always let user use another cookbook to install dependencies.
# dependency install type:
#
# - auto: let the cookbook try to figure it out
# - none: will be installed by other means and available in system path
#
default["lita"]["ruby_install_type"]  = "auto"
default["lita"]["redis_install_type"] = "auto"

It doesn't make any sense to require those cookbooks to be uploaded to chef-server if I'm not going to use them:
% knife cookbook upload lita
Uploading lita           [0.0.3]
ERROR: Cookbook lita depends on cookbooks which are not currently
ERROR: being uploaded and cannot be found on the server.
ERROR: The missing cookbook(s) are: 'ruby-ng' version '~> 0.1.1', 'redis2' version '~> 0.5.0'

It's a common problem for most cookbooks. Is there a good way to work it around?


--
Best regards,
Koldaev Anton



Archive powered by MHonArc 2.6.16.

§