-
Notifications
You must be signed in to change notification settings - Fork 100
Don't remove cookbook paths, just add to list berkshelf cookbook path #9
Conversation
It's a known issue right now that you can't manipulate the The problem is that the value of The suggested way to operate with Berkshelf is to NOT have a "cookbooks" directory at all. |
Thanks, @reset . But I also need site-cookbooks directory with my custom cookbooks. This is standart directory for Chef Solo - http://matschaffer.github.com/knife-solo/. And right now it is not work without this fix. |
And also I set this folders, so I should deside have I "cookbooks" folders or doesn't on my mashine. If I don't have such folder I can write:
And its very easy. In berkshelf-vagrant, which installed by "vagrant plugin" and run even if you don't have berkshelf in your project user can fix this problem only by manual editing this file in "~/.vagrant.d" directory (or just remove "berkshelf-vagrant" for valid workflow). |
I also added new option "disabled" to berkshelf-vagrant. For now: Vagrant.configure("2") do |config|
config.vm.box = "rwpreise64"
config.berkshelf.disabled = true
end Will work without any error with installed berkshelf-vagrant and project, which not use berkshelf. If you wish I can push this change as separate pull request. |
If you want to pull in cookbooks from your local cookbooks directory, you can just add something like this to your Berksfile:
|
You can also use Dir.glob(File.expand_path('../site-cookbooks/*', __FILE__)).each do |path|
metadata :path => path
end Actually this seems to be so common pattern for me that I was thinking if Berkshelf could support it natively. Maybe |
@tmatilai The Berkshelf way is somewhat antithetical to cookbooks/site-cookbooks, so my initial reaction is that that should be a plugin and not in Berkshelf, and that I'd love to spend 10 minutes in chat convincing you to give up site-cookbooks. Worth having the discussion on adding this as a feature in RiotGames/berkshelf though. (I like @mconigliaro's better, personally, since it uses cookbook and not metadata) |
@le0pard as @reset mentioned, the suggested way to operate with Berkshelf is without a "cookbooks" or "site-cookbooks" directory. As a workaround, you can disable the plugin with I'm going to close this, but if people feel strongly that we're wrong on this, please feel free to re-open. Also, happy to discuss in IRC anytime. |
@ivey heh, I might have exaggerated a bit. =) But the case where I still mostly create site-cookbooks are projects that spin up and provision a server for one time use. Or something that is a better fit for chef-solo anyway. In the same repository I have setup for local testing with Vagrant and "the real thing" with knife-solo. Normally these projects have one or a couple of cookbooks that are specific to that project and thus I feel it is more efficient to develop with tight integration. |
you can manage it like that. `cookbook "artifact", path: "/Users/reset/code/artifact-cookbook"`` I think appending is more intuitive |
"It's a known issue right now that you can't manipulate the cookbooks_path configuration value, but it was a conscious choice." So I'd suggest at least a warning message if people do set the path? Not great to break a lot of very standard chef setups, especially with loads of people moving from vagrant v1 and v2. |
I second that warning thing, as this behaviour was totally unexpected for me. Also, a note in the readme and on http://berkshelf.com/ would be quite helpful. |
I think everyone is wasting collective cycles with the lack of a clear warning message and/or documentation. |
Pull requests welcomed on that warning message |
Don't remove cookbook paths, just add to list berkshelf cookbook path.
The problem what I can have also own directories with cookbooks:
berkshelf should add own directory to this list (shouldn't remove my list).