[chef] Re: Re: Demonstrating the Power of Chef, Librarian and Vagrant

Chronological Thread 
  • From: Jeremiah Snapp < >
  • To:
  • Subject: [chef] Re: Re: Demonstrating the Power of Chef, Librarian and Vagrant
  • Date: Sun, 22 Apr 2012 00:04:24 -0400

Thanks Joshua for the feedback.  I'm sorry if my description confused things.  I'll try to make some changes to my document to make it more clear.

My primary reason for choosing to only have a single "authoritative" directory for cookbooks in the cookbook_path knife.rb parameter comes from my use of Librarian for cookbook management.  Rather than tell knife to look in multiple locations for cookbooks my knife knows only one directory chef-repo/cookbooks.

My Librarian Cheffile however knows where all the cookbooks' source code are whether they are on the community site, github, someone's git server, or on my local disk.  I let Librarian pull all those cookbooks (and dependencies) together into the untracked chef-repo/cookbooks directory.  Then I can just 'knife cookbook upload' the cookbooks from there.

It seems like using multiple paths in knife.rb cookbook_path while also using Librarian could potentially be problematic even after identical cookbook merging gets completely deprecated.  For example, let's say you have modified the Perl cookbook in chef-repo/site-cookbooks and you add Logwatch cookbook to the Librarian Cheffile.  Then Librarian will put Logwatch and it's dependency Perl into chef-repo/cookbooks because Librarian isn't aware of your modified Perl cookbook in chef-repo/site-cookbooks.  Now knife's cookbook_path will be aware of two Perl cookbooks.  I don't know what would happen when you try to upload these cookbooks after cookbook merging is completely deprecated.  I suppose knife would have an order of precedence based on the order of paths in cookbook_path.

I would avoid the problem by using ':path'  to source the site-cookbooks/perl cookbook in Librarian so it is aware of it.  But then why not do that for all the cookbooks in chef-repo/site-cookbooks which makes having site-cookbooks unnecessary in knife's cookbook_path.

I'd rather avoid the complexity by relying on Librarian to get all the cookbooks and put them in one location and make knife aware of that one location.

Archive powered by MHonArc 2.6.16.