Please clarify berks install

When I do a berks install -c $BERKSHELF_PATH/config.json, and my config file looks like this, I understand that berks will fetch the cookbooks “from” the chef_server_url and install them “to” my $BERKSHELF_PATH/cookbooks directory correct?

{
“chef”:{
“chef_server_url” : “https://chefserver/organizations/berks-api”,
“validation_client_name” : “berks-api-validator”,
“validation_key_path” : “.chef/chefserver-berks-api-validator.pem”,
“client_key” : “.chef/jenkins.pem”,
“node_name” : “jenkins”
},
“cookbook”:{
“copyright”:“Build Team”,
“email”:"buildteam@domain.com"
},
“ssl”:{
“verify”:false
}
}

My Berksfile has
source http://chefserver:26200
cookbook ‘common-log’

My metadata.rb has
depends ‘common-log’, ‘~> 0.1.1’

I ask because it fails saying

Missing artifacts: common-log~> 0.1.1

But if I do “knife cookbook list” where my knife.rb file points to the SAME chef_server_url, I see

common-log 0.1.2

So why won’t berks install fetch “common-log v0.1.2” from my Berks API server?

Chris

On Monday, May 18, 2015 at 7:56 AM, Fouts, Chris wrote:

When I do a berks install –c $BERKSHELF_PATH/config.json, and my config file looks like this, I understand that berks will fetch the cookbooks “from” the chef_server_url and install them “to” my $BERKSHELF_PATH/cookbooks directory correct?

{
"chef":{
"chef_server_url" : "https://chefserver/organizations/berks-api",
"validation_client_name" : "berks-api-validator",
"validation_key_path" : ".chef/chefserver-berks-api-validator.pem",
"client_key" : ".chef/jenkins.pem",
"node_name" : "jenkins"
},
"cookbook":{
"copyright":"Build Team",
"email":"buildteam@domain.com (mailto:buildteam@domain.com)"
},
"ssl":{
"verify":false
}
}

My Berksfile has
source http://chefserver:26200
cookbook ‘common-log’

My metadata.rb has
depends ‘common-log’, ‘~> 0.1.1’

I ask because it fails saying

Missing artifacts: common-log~> 0.1.1

But if I do “knife cookbook list” where my knife.rb file points to the SAME chef_server_url, I see

common-log 0.1.2

So why won’t berks install fetch “common-log v0.1.2” from my Berks API server?

Berks relies on there being an HTTP(S) server with a full list of all cookbooks (with dependency info) available from a given source. The Chef Server does not provide this by default, so the workaround is to run a berks-api service, which is a totally separate HTTP application. The berks API service periodically spiders the cookbooks on your Chef Server and generates the full list of cookbooks (the jargon for this is a “universe endpoint”). The other option is to run an internal copy of the “supermarket” application, which is just a thing you can upload cookbooks to and will create the “universe” endpoint.

HTH,

Chris

--
Daniel DeLeo

I have a berks-API server running.

Chris

-----Original Message-----
From: Daniel DeLeo [mailto:ddeleo@kallistec.com] On Behalf Of Daniel DeLeo
Sent: Monday, May 18, 2015 2:20 PM
To: chef@lists.opscode.com
Subject: [chef] Re: Please clarify berks install

On Monday, May 18, 2015 at 7:56 AM, Fouts, Chris wrote:

When I do a berks install –c $BERKSHELF_PATH/config.json, and my config file looks like this, I understand that berks will fetch the cookbooks “from” the chef_server_url and install them “to” my $BERKSHELF_PATH/cookbooks directory correct?

{
"chef":{
"chef_server_url" : "https://chefserver/organizations/berks-api",
"validation_client_name" : "berks-api-validator",
"validation_key_path" : ".chef/chefserver-berks-api-validator.pem",
"client_key" : ".chef/jenkins.pem",
"node_name" : "jenkins"
},
"cookbook":{
"copyright":"Build Team",
"email":"buildteam@domain.com (mailto:buildteam@domain.com)"
},
"ssl":{
"verify":false
}
}

My Berksfile has
source http://chefserver:26200
cookbook ‘common-log’

My metadata.rb has
depends ‘common-log’, ‘~> 0.1.1’

I ask because it fails saying

Missing artifacts: common-log~> 0.1.1

But if I do “knife cookbook list” where my knife.rb file points to the
SAME chef_server_url, I see

common-log 0.1.2

So why won’t berks install fetch “common-log v0.1.2” from my Berks API server?

Berks relies on there being an HTTP(S) server with a full list of all cookbooks (with dependency info) available from a given source. The Chef Server does not provide this by default, so the workaround is to run a berks-api service, which is a totally separate HTTP application. The berks API service periodically spiders the cookbooks on your Chef Server and generates the full list of cookbooks (the jargon for this is a “universe endpoint”). The other option is to run an internal copy of the “supermarket” application, which is just a thing you can upload cookbooks to and will create the “universe” endpoint.

HTH,

Chris

--
Daniel DeLeo

On Monday, May 18, 2015 at 11:42 AM, Fouts, Chris wrote:

I have a berks-API server running.

Chris
Derp, I missed that part. Anyway, you should be able to curl the universe URL, I think it’s just /universe on the berks API server, to see what cookbooks it says are available. If it’s not there, then something is not working with your berks-api server, it could be stuck or it might just be refreshing too slowly.

--
Daniel DeLeo