1
votes

I'm trying to use Berkshelf to upload a cookbook with a few dependencies to my Chef-Server. When I use chef exec berks upload I am presented with a bunch of different errors. My current setup is using the latest, or close to, ChefDK versions using a chef_repo with the following file structure. I have multiple repos for the multipe different Orgs I'm hooked into for different Chef-Servers. I don't have anything in my $HOME/.chef/, or on Windows, C:\chef\, doesn't even exist. I'm sharing the same chef_repo between my Windows, CentOS 7 VM, and my Docker container, so that hasn't changed. The chef_repo was generated by using the chef generate repo command.

https://gist.github.com/predatorian3/24ba83bd7e98ac7300bf#file-chefdk_repo_setup

The contents of my knife.rb are as follows

https://gist.github.com/predatorian3/24ba83bd7e98ac7300bf#file-00-knife-rb

I'm not sure what I'm doing wrong when I'm attempting to upload these cookbooks using Berkshelf.

On CMD, using Cmder

https://gist.github.com/predatorian3/24ba83bd7e98ac7300bf#file-chefdk_cmder_berks-rb

As you can see in this Gist, I was able to do a chef exec knife ssl check and it succeeded.

On Cygwin

https://gist.github.com/predatorian3/24ba83bd7e98ac7300bf#file-chefdk_cygwin_berks-rb

On CentOS 7,

https://gist.github.com/predatorian3/24ba83bd7e98ac7300bf#file-chefdk_centos7_berks-rb

On CentOS 7 using Docker's CentOS 7 image,

https://gist.github.com/predatorian3/24ba83bd7e98ac7300bf#file-chefdk_docker_centos7_berks-rb

Using a pure Ruby install, and the Chef RubyGem and Berkshelf gem installed, yielded the same errors, except the parts about some webagent cookie, which I suppose is good.

--EDIT 2016-02-27--

As a temporary work around, I had to use --no-ssl-verify in order for berks to upload the cookbooks. However, it seems to be a bug with ridley-4.3.2. Then berks is also not "honoring" the ENV[SSL_CERTS_DIR] or ENV[SSL_CERTS_FILE] statements in my knife.rb There's a bug submitted for it already. I guess this bug is an outstanding bug.

1

1 Answers

1
votes

Berkshelf uses its own config parsing system which might be unable to read your knife.rb successfully. This isn't super likely, but some permutation of that or not looking in the right folder is probably a contributing factor. You can make this a non-issue by creating a Berkshelf config.json with the required data.