berkshelf | A Chef Cookbook manager | Infrastructure Automation library
kandi X-RAY | berkshelf Summary
kandi X-RAY | berkshelf Summary
Manage Chef Infra cookbooks and cookbook dependencies.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Try to download a cookbook from a cookbook
- Removes all files in the lock .
- Copies the source files into the source directory .
- Find the cookbook for the cookbook .
- Creates a cookbook from the Chef server
- Iterates over each key in the database .
berkshelf Key Features
berkshelf Examples and Code Snippets
Community Discussions
Trending Discussions on berkshelf
QUESTION
knife and berkshelf are both used for uploading the cookbook. the berkshelf is taking care of "third party dependencies" as well feom berkfile or Metadata.rb. Is that the only difference or there is more to it?
...ANSWER
Answered 2020-Oct-09 at 04:46In a loose sense, Berkshelf is a kind of "package manager" for Chef cookbooks.
It is somewhat like what yum
is to rpm
, or what apt-get
is to dpkg
.
As you pointed out, Berkshelf provides dependency management for a given Chef cookbook. It can not only pull external dependencies, but dependent cookbooks (and versions) from a given code (Git/Bitbucket) repository. And with larger Chef deployments, there is always the complication of managing multiple dependencies.
Sometimes the dependencies are immediately obvious. Just to illustrate this, if I have a cookbook my_rabbitmq_server
, with metadata.rb
as:
QUESTION
i am managing my cookbooks with berkshelf. i would like to play a little bit with the cookbook dependency graph. for instance:
- given a cookbook, get its dependencies (the same as the resolver does it)
- given a cookbook, get depended cookbooks (same as
berks contingent
)
i tried
...ANSWER
Answered 2018-Apr-29 at 01:16This is not supported, or anything even in the same area code as supported. We have no public Ruby APIs for this data, sorry. You can look at the Solve gem, but it's not really used outside of our own use cases.
QUESTION
This is driving me crazy, I just started using chef on a fresh image (win10), and for some reason when using kitchen to test a cookbook it can not find the cookbook? tried the response to this question: Chef solo can't find cookbook during kitchen test run and it throws an error saying "Your Berksfile contains multiple entries named 'printserver'. Please remove duplicate dependencies, or put them in different groups.] on default-win-2012r2-standard-amd64-nocm" Kitchen version 1.17.0
...ANSWER
Answered 2017-Sep-22 at 18:30Add the following to Berksfile (under "metadata"):
QUESTION
This problem arises when you:
- Write a library cookbook (i.e. it has no recipes apart from a no-op default.rb)
- Create a
test
cookbook undertest/fixtures/cookbooks/
to exercise the library. That istest/fixtures/cookbooks/test/recipes/system.rb
- Write a ChefSpec spec that
describe 'test::system'
- Use Policyfiles rather than Berkshelf.
When using Berkshelf you would use group :integration do ... end
to include the test cookbook only when running tests.
How do you write a Policyfile that only references the test cookbook when running tests?
Right now I have my policyfile always packaging the test cookbook. Not ideal but acceptable to get something that just works in a test environment. Not sustainable over the longer term.
Appreciate any hints, tips or incantations.
...ANSWER
Answered 2019-Sep-06 at 16:09Create two Policyfiles.
One of them contains the recipes/attributes that you would run on a "real" node. The other contains what is needed to exercise the cookbook in test kitchen.
You can specify a Policyfile path in kitchen.rb
.
QUESTION
Artifactory 5.8.4 Professional
Chef Development Kit Version: 1.1.16
chef-client version: 12.17.44
delivery version: master (83358fb62c0f711c70ad5a81030a6cae4017f103)
berks version: 5.2.0
kitchen version: 1.14.2
In Artifactory, I have this repository (virtual): avirtual-repo
Berksfile contains:
...ANSWER
Answered 2019-Aug-29 at 16:44One simple simple solution is to restart Artifactory service on the machine.
OR
Try this solution: To change the source file for the gem and bump the values. Save it, retry berks install
to see. Restart Chef if required.
For ex:: Change values in the following file, line containing options
and values i.e. retry to 3, retry_interval to 1 or 2, open_timeout to 60 and timeout to 60.
QUESTION
Mac OS X 10.14.5 (Mojave)
VirtualBox 6.0.10 r132072
Vagrant 2.2.5
Vagrant Box 'bento/ubuntu-16.04' version '201906.18.0'
- Updated VirtualBox and Vagrant.
- Destroyed and recreated the Vagrant Box.
This just started happening, I reinstalled VirtualBox and Vagrant, updated the Vagrant Box, but to no avail:
...ANSWER
Answered 2019-Aug-16 at 06:45there is a line in your output that hints what is wrong
QUESTION
I am new to Vagrant. I am trying to get a suitable developement envirement in order to create a symfony project but for some reason, I can't seem to get this working. What ever machine i build i always get stuck at the "SSH auth method: private key" line.
I made a lot of reading in the past 2 days and this problem seems to happend for various reasons. I tryed everything on satck overflow but just can't seem to pin point what is causing my setup to fail.
I am on my laptop that has windows 10. I have VirtualBox 6.0.8 and Vagrant 2.2.4.
I tryed 4 diffrent boxes including one I builded using Chef and a more generic box that suposidly would work (hashicorp/precise64)
So I am confident the problem is somewhere else that in the vagrantfile.
I have virtualization active in my BIOS ... cheked twice.
I tryed using the git console, the windows cmd with and without admin permission as well as powershell (Just in case) and got the same result.
ssh-config says the following:
...ANSWER
Answered 2019-May-27 at 01:20After almost 4 days at this, i finally got it working ... My hard drive drop dead so I had to replace it and reinstall windows and all my stuff. First thing I did was try vagrant and virtualbox again. It worked on the first try. I suspect that there was something wrong with VirtualBox and the network (meaning my physical interfaces). Unfortunately, that's all I can say about it since I never got to the bottom of this problem. If like me, you tried everything and you still have the same problem I had, you should take a look at your network. I am not gona tell you to reinstall windows ... that would be insane ... But something somewhere was broken and now everything works as expected. Weird but true!
QUESTION
I having an issue when running kitchen converge
on Test Kitchen with Dokken driver
and Inspec
as verifier.
The error occurred when the starting to resolving the cookbook dependencies 7.0.6
Resolving cookbook dependencies with Berkshelf 7.0.6...
[2019-06-18T15:17:56+08:00] ERROR: Connection refused connecting to https://localhost/cookbooks/apache2/3.1.0, retry 1/5
[2019-06-18T15:17:56+08:00] ERROR: Connection refused connecting to https://localhost/cookbooks/alternatives/0.1.1, retry 1/5
[2019-06-18T15:18:01+08:00] ERROR: Connection refused connecting to https://localhost/cookbooks/apache2/3.1.0, retry 2/5
[2019-06-18T15:18:01+08:00] ERROR: Connection refused connecting to https://localhost/cookbooks/alternatives/0.1.1, retry 2/5
Any idea?
Thanks!
...ANSWER
Answered 2019-Jun-18 at 09:06I resolved the issue by adding the new parameter inside the ~/.chef/knife.rb
, chef_server_url 'https://chef-server-url'
QUESTION
A Berksfile is missing on a cookbook that's why I want to create a new one
I just want to generate a berksfile on an existing cookbook.
So when I try to run the command:
berks cookbook name_of_my_cookbook
I'm getting the following error
/opt/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems.rb:271:
in find_spec_for_exe: can't find gem berkshelf (>= 0.a) (Gem::GemNotFoundException)
from /opt/chef/embedded/lib/ruby/site_ruby/2.3.0/rubygems.rb:299:in activate_bin_path
from /usr/local/bin/berks:23:in
'
I tried to install berkshelf again via gem install berkshelf
but I'm getting another error message:
ERROR: Error installing berkshelf:
There are no versions of solve (~> 4.0) compatible with your Ruby & RubyGems. Maybe try installing an older version of the gem you're looking for?
solve requires Ruby version >= 2.1.0. The current ruby version is .
I have no other idea to solve this issue. I'm quite a newbie on this so I appreciate any help.
...ANSWER
Answered 2018-Jun-26 at 18:24There is no reason to use berks cookbook
anymore and I'm pretty sure it was removed years ago. It sounds like your first problem is that your gem environment is very broken. We only support Berkshelf via the ChefDK installers, not gem install berkshelf
. You appear to have the chef-client
installer, not ChefDK
, so fix that first. Then if you just want a standard Berksfile it's:
QUESTION
I've been getting this error as of recent for a couple cookbooks I'm trying to test with "chef exec rspec":
...ANSWER
Answered 2018-Jun-06 at 18:57Update: I was running ChefDK 2.5.3 and updated to 3.0.36 and the issue went away. I don't know if there was a compatibility issue or if the files were messed up and a fresh install solved the issue.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install berkshelf
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page