matschaffer/knife-solo — Issue #12: Sync only the recipes from your cookbook_path
Author: silasb
Created: 2012-01-18 21:04:54+00:00
State: open

In `$HOME/.chef/knife.rb` you can specify `cookbook_path`. What would be ideal would be it would only transfer those cookbooks which recipes we depend on. First we look in the local repository, then we look into the user defined `cookbook_path` then the global `cookbook_path` if one exists.

cookbooks = json[:run_list].map{ |r| r.gsub(/recipe\[(\w+)(-(\d|\.)+)?(:{2}(\w+))*\]/, "\\1") }

cookbooks.map! { |c| File.join(Chef::Config.cookbook_path, c) }

Then somehow include those in with the rsync command.