Open tknerr opened 11 years ago
For me this is a common scenario. Typically I have both Cheffile
and Vagrantfile
inside a cookbook's directory so I can do a librarian-chef install && vagrant up
for a testing the cookbook in a Vagrant VM.
Until now I have to set chef.cookbooks_path = [ './cookbooks', '..' ]
in the Vagrantfile
to make both the resolved dependencies and the cookbook itself (via '..'
) available in vagrant.
This is bad because it potentially includes lots of other cookbooks from '..'
which can cause all sorts of trouble, so I consider it broken.
That's why I added cookbook "foo", :path => '..'
to Cheffile
so that all cookbooks including "self" are resolved to ./cookbooks
. Then the chef.cookbooks_path = [ './cookbooks' ] in the
Vagrantfile` is properly isolated again.
When you have
Cheffile
inside a cookbook directory, and then try to resolve that via:path
it fails because it can not copy to itself (see stacktrace below).Cheffile
Stacktrace