Reputation: 6681
I have two cooksbooks that I created in my Chef repo that I want to try to manage using Berkshelf.
One cookbook is dependent on the other. Both are not in Chef Supermarket. I don't want to add them there just for dependency resolving.
On on berks install this things complains about the other cookbook is missing.
This cookbook only exist as upload to my Chef server. It is not in Chef supermarket and also not in ~/.berkshelf/cookbooks/
Is this possible? Or does Berkshelf require all recipes in one cookbook? It is not possible to have dependencies between two cookbooks that are not in Chef supermarket?
The Berkshelf does not seem to deal with this use case of multiple interdependent cookbooks. There are also no commands to get cookbooks in ~/.berkshelf/cookbooks.
Upvotes: 1
Views: 1381
Reputation: 581
Berkshelf do support multiple cookbooks. I've experience in managing more than 30 cookbooks in same berkshelf. Berks can refer cookbooks from local path, git path, github sources and community cookbooks from Chef super market.
Update
Lets take the example of the scenario mentioned in the query. Please carry out the below steps,
cookbooks
directory.Berksfile
in the root of the repo.Berksfile
uses berkshelf. Install latest berkshelf version using gem install berkshelf
(I would prefer using bundle install)Example content of Berksfile
source "https://supermarket.chef.io"
# Mention community cookbooks used, if any
cookbook 'community_cookbook_name'
# Mention cookbook names from your repo
%w(my_cookbook_name_1 my_cookbook_name_2).each do | cookbook_name |
cookbook cookbook_name, path: 'cookbooks/' + cookbook_name
end
Now the basic project repo setup has been done. You're ready to run berks install
List items berks list
Please try the above steps and let me know if it's solved your purpose.
Run the command mentioned below from inside the project repo.
berks upload
Your cookbooks will be uploaded to Chef server using the command.
You can use knife upload data_bags and knife upload roles, to upload your databags and roles from the repo.
Upvotes: 5