Managing dependencies via Berkshelf

Hi,
I have a question about Berkshelf and dependency management (sorry, maybe
it's silly).
I've written cookbook my_nginx which depends on cookbook nginx that is
located on our production chef-server. I want to use Vagrant + Berkshelf
for testing it.
So i wrote in metadata.rb

depends "nginx"

and in Berksfile

metadata
cookbook 'nginx', chef_api: :config

When i execute berks install, i get cookbook from our Chef server in
~/.berkshelf/cookbooks/nginx-1.7.0. However, when i use vagrant up it
downloads dependency from https://cookbooks.opscode.com/api/v1/ to
~/.berkshelf/default/vagrant/berkshelf-20130812-xxxxx and there are absent
some recipes i need.

What I need to do for downloading dependencies from my Chef server when i
use vagrant?

Additional info:
Vagrant version 1.2.7
Berkshelf (2.0.6)
vagrant-berkshelf (1.3.2)
$ vagrant plugin list
vagrant-berkshelf (1.3.3)
vagrant-omnibus (1.1.0)

My ~/.berkshelf/config.json

{
"chef":{
"chef_server_url":"http://api.chef.organization.com",
"validation_client_name":"chef-validator",
"validation_key_path":"/home/user/.chef/validation.pem",
"client_key":"/home/lexx/.chef/user.pem",
"node_name":"user"
},
"vagrant":{
"vm":{
"box":"Centos_chef11",
"box_url":"http://vagrant.server/vagrant_berkshelf.box",
"forward_port":{
},
"network":{
"bridged":false,
"hostonly":"33.33.33.10"
},
"provision":"chef_solo"
}
},
"ssl":{
"verify":true
}
}

Thanks!
Please excuse my bad English.

Did you try removing the depends line from the metadata.rb? That shouldn’t be required, especially if you’re explicitly declaring it in the Berksfile so that it can be downloaded from your local Chef server.

From: Aleksandr Chumakov <lexx@gts.dp.uamailto:lexx@gts.dp.ua>
Reply-To: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Date: Monday, August 12, 2013 10:14 AM
To: "chef@lists.opscode.commailto:chef@lists.opscode.com" <chef@lists.opscode.commailto:chef@lists.opscode.com>
Subject: [chef] Managing dependencies via Berkshelf

Hi,
I have a question about Berkshelf and dependency management (sorry, maybe it’s silly).
I’ve written cookbook my_nginx which depends on cookbook nginx that is located on our production chef-server. I want to use Vagrant + Berkshelf for testing it.
So i wrote in metadata.rb
depends "nginx"
and in Berksfile
metadata
cookbook ‘nginx’, chef_api: :config
When i execute berks install, i get cookbook from our Chef server in ~/.berkshelf/cookbooks/nginx-1.7.0. However, when i use vagrant up it downloads dependency from https://cookbooks.opscode.com/api/v1/ to ~/.berkshelf/default/vagrant/berkshelf-20130812-xxxxx and there are absent some recipes i need.

What I need to do for downloading dependencies from my Chef server when i use vagrant?

Additional info:
Vagrant version 1.2.7
Berkshelf (2.0.6)
vagrant-berkshelf (1.3.2)
$ vagrant plugin list
vagrant-berkshelf (1.3.3)
vagrant-omnibus (1.1.0)

My ~/.berkshelf/config.json
{
“chef”:{
“chef_server_url”:“http://api.chef.organization.comhttp://api.chef.organization.com/”,
“validation_client_name”:“chef-validator”,
“validation_key_path”:"/home/user/.chef/validation.pem",
“client_key”:"/home/lexx/.chef/user.pem",
“node_name”:“user”
},
“vagrant”:{
“vm”:{
“box”:“Centos_chef11”,
“box_url”:“http://vagrant.server/vagrant_berkshelf.box”,
“forward_port”:{
},
“network”:{
“bridged”:false,
“hostonly”:“33.33.33.10”
},
“provision”:“chef_solo”
}
},
“ssl”:{
“verify”:true
}
}

Thanks!
Please excuse my bad English.

Hey Aleksandr,

Looks like you've run into a potential bug with the 2.0.6 release of
Berkshelf. We had similar reports that I know we've definitely fixed in the
master branch and the most current beta release of Berkshelf. We also
released 2.0.8 which may contain the fix to your issue as well.

I would start by re-installing the vagrant-berkshelf plugin to ensure that
it picks up the very latest version of Berkshelf. You can do that with $ vagrant plugin uninstall vagrant-berkshelf && $ vagrant plugin install vagrant-berkshelf.

If you are still experiencing issues open a ticket on the Berkshelf issue
tracker Sign in to GitHub · GitHub and we'll help
you get it sorted.

note: it's possible to use the beta version of Berkshelf with Vagrant
Berkshelf, but it requires you to jump through a few hoops.

On Mon, Aug 12, 2013 at 8:52 AM, Tim Green tgreen@opscode.com wrote:

Did you try removing the depends line from the metadata.rb? That
shouldn't be required, especially if you're explicitly declaring it in the
Berksfile so that it can be downloaded from your local Chef server.

From: Aleksandr Chumakov lexx@gts.dp.ua
Reply-To: "chef@lists.opscode.com" chef@lists.opscode.com
Date: Monday, August 12, 2013 10:14 AM
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Managing dependencies via Berkshelf

Hi,
I have a question about Berkshelf and dependency management (sorry, maybe
it's silly).
I've written cookbook my_nginx which depends on cookbook nginx that is
located on our production chef-server. I want to use Vagrant + Berkshelf
for testing it.
So i wrote in metadata.rb

depends "nginx"

and in Berksfile

metadata
cookbook 'nginx', chef_api: :config

When i execute berks install, i get cookbook from our Chef server in
~/.berkshelf/cookbooks/nginx-1.7.0. However, when i use vagrant up it
downloads dependency from https://cookbooks.opscode.com/api/v1/ to
~/.berkshelf/default/vagrant/berkshelf-20130812-xxxxx and there are absent
some recipes i need.

What I need to do for downloading dependencies from my Chef server when
i use vagrant?

Additional info:
Vagrant version 1.2.7
Berkshelf (2.0.6)
vagrant-berkshelf (1.3.2)
$ vagrant plugin list
vagrant-berkshelf (1.3.3)
vagrant-omnibus (1.1.0)

My ~/.berkshelf/config.json

{
"chef":{
"chef_server_url":"http://api.chef.organization.com",
"validation_client_name":"chef-validator",
"validation_key_path":"/home/user/.chef/validation.pem",
"client_key":"/home/lexx/.chef/user.pem",
"node_name":"user"
},
"vagrant":{
"vm":{
"box":"Centos_chef11",
"box_url":"http://vagrant.server/vagrant_berkshelf.box",
"forward_port":{
},
"network":{
"bridged":false,
"hostonly":"33.33.33.10"
},
"provision":"chef_solo"
}
},
"ssl":{
"verify":true
}
}

Thanks!
Please excuse my bad English.

--
Jamie Winsor
@resetexistence http://twitter.com/resetexistence

Hey Jamie,

how do I know which version of Berkshelf comes with vagrant-berkshelf?

Just wondering since I thought that the Berkshelf version would be pinned
by vagrant-berkshelf...

Cheers,
Torben

On Mon, Aug 12, 2013 at 7:34 PM, Jamie Winsor jamie@vialstudios.com wrote:

Hey Aleksandr,

Looks like you've run into a potential bug with the 2.0.6 release of
Berkshelf. We had similar reports that I know we've definitely fixed in the
master branch and the most current beta release of Berkshelf. We also
released 2.0.8 which may contain the fix to your issue as well.

I would start by re-installing the vagrant-berkshelf plugin to ensure that
it picks up the very latest version of Berkshelf. You can do that with $ vagrant plugin uninstall vagrant-berkshelf && $ vagrant plugin install vagrant-berkshelf.

If you are still experiencing issues open a ticket on the Berkshelf issue
tracker Sign in to GitHub · GitHub and we'll help
you get it sorted.

note: it's possible to use the beta version of Berkshelf with Vagrant
Berkshelf, but it requires you to jump through a few hoops.

On Mon, Aug 12, 2013 at 8:52 AM, Tim Green tgreen@opscode.com wrote:

Did you try removing the depends line from the metadata.rb? That
shouldn't be required, especially if you're explicitly declaring it in the
Berksfile so that it can be downloaded from your local Chef server.

From: Aleksandr Chumakov lexx@gts.dp.ua
Reply-To: "chef@lists.opscode.com" chef@lists.opscode.com
Date: Monday, August 12, 2013 10:14 AM
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Managing dependencies via Berkshelf

Hi,
I have a question about Berkshelf and dependency management (sorry, maybe
it's silly).
I've written cookbook my_nginx which depends on cookbook nginx that is
located on our production chef-server. I want to use Vagrant + Berkshelf
for testing it.
So i wrote in metadata.rb

depends "nginx"

and in Berksfile

metadata
cookbook 'nginx', chef_api: :config

When i execute berks install, i get cookbook from our Chef server in
~/.berkshelf/cookbooks/nginx-1.7.0. However, when i use vagrant up it
downloads dependency from https://cookbooks.opscode.com/api/v1/ to
~/.berkshelf/default/vagrant/berkshelf-20130812-xxxxx and there are absent
some recipes i need.

What I need to do for downloading dependencies from my Chef server when
i use vagrant?

Additional info:
Vagrant version 1.2.7
Berkshelf (2.0.6)
vagrant-berkshelf (1.3.2)
$ vagrant plugin list
vagrant-berkshelf (1.3.3)
vagrant-omnibus (1.1.0)

My ~/.berkshelf/config.json

{
"chef":{
"chef_server_url":"http://api.chef.organization.com",
"validation_client_name":"chef-validator",
"validation_key_path":"/home/user/.chef/validation.pem",
"client_key":"/home/lexx/.chef/user.pem",
"node_name":"user"
},
"vagrant":{
"vm":{
"box":"Centos_chef11",
"box_url":"http://vagrant.server/vagrant_berkshelf.box",
"forward_port":{
},
"network":{
"bridged":false,
"hostonly":"33.33.33.10"
},
"provision":"chef_solo"
}
},
"ssl":{
"verify":true
}
}

Thanks!
Please excuse my bad English.

--
Jamie Winsor
@resetexistence http://twitter.com/resetexistence

It is pinned by Vagrant-Berkshelf, but it is pinned with a pessimistic
operator (~> 2.0.7). The plugin and Berkshelf are not released in lock step
and Vagrant has it's own gem store that it leverages. This means that the
version of Berkshelf that you install with gem install berkshelf is not
the same gem installation that the Vagrant-Berkshelf plugin is using.

When you install Vagrant-Berkshelf it will also install Berkshelf into it's
own gem store. The easiest way to make sure you have the latest version of
Berkshelf in the gem store is to re-install Vagrant-Berkshelf. This manner
of troubleshooting isn't exactly what we want, so I will bring up releasing
the plugin and Berkshelf in lock step at the next triage meeting.

You can see what version of Berkshelf the Vagrant-Berkshelf plugin is using
by inspecting Vagrant's gem store (~/.vagrant.d/gems/gems).

On Mon, Aug 12, 2013 at 12:52 PM, Torben Knerr ukio@gmx.de wrote:

Hey Jamie,

how do I know which version of Berkshelf comes with vagrant-berkshelf?

Just wondering since I thought that the Berkshelf version would be pinned
by vagrant-berkshelf...

Cheers,
Torben

On Mon, Aug 12, 2013 at 7:34 PM, Jamie Winsor jamie@vialstudios.comwrote:

Hey Aleksandr,

Looks like you've run into a potential bug with the 2.0.6 release of
Berkshelf. We had similar reports that I know we've definitely fixed in the
master branch and the most current beta release of Berkshelf. We also
released 2.0.8 which may contain the fix to your issue as well.

I would start by re-installing the vagrant-berkshelf plugin to ensure
that it picks up the very latest version of Berkshelf. You can do that with
$ vagrant plugin uninstall vagrant-berkshelf && $ vagrant plugin install vagrant-berkshelf.

If you are still experiencing issues open a ticket on the Berkshelf issue
tracker Sign in to GitHub · GitHub and we'll help
you get it sorted.

note: it's possible to use the beta version of Berkshelf with Vagrant
Berkshelf, but it requires you to jump through a few hoops.

On Mon, Aug 12, 2013 at 8:52 AM, Tim Green tgreen@opscode.com wrote:

Did you try removing the depends line from the metadata.rb? That
shouldn't be required, especially if you're explicitly declaring it in the
Berksfile so that it can be downloaded from your local Chef server.

From: Aleksandr Chumakov lexx@gts.dp.ua
Reply-To: "chef@lists.opscode.com" chef@lists.opscode.com
Date: Monday, August 12, 2013 10:14 AM
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Managing dependencies via Berkshelf

Hi,
I have a question about Berkshelf and dependency management (sorry,
maybe it's silly).
I've written cookbook my_nginx which depends on cookbook nginx that is
located on our production chef-server. I want to use Vagrant + Berkshelf
for testing it.
So i wrote in metadata.rb

depends "nginx"

and in Berksfile

metadata
cookbook 'nginx', chef_api: :config

When i execute berks install, i get cookbook from our Chef server in
~/.berkshelf/cookbooks/nginx-1.7.0. However, when i use vagrant up it
downloads dependency from https://cookbooks.opscode.com/api/v1/ to
~/.berkshelf/default/vagrant/berkshelf-20130812-xxxxx and there are absent
some recipes i need.

What I need to do for downloading dependencies from my Chef server
when i use vagrant?

Additional info:
Vagrant version 1.2.7
Berkshelf (2.0.6)
vagrant-berkshelf (1.3.2)
$ vagrant plugin list
vagrant-berkshelf (1.3.3)
vagrant-omnibus (1.1.0)

My ~/.berkshelf/config.json

{
"chef":{
"chef_server_url":"http://api.chef.organization.com",
"validation_client_name":"chef-validator",
"validation_key_path":"/home/user/.chef/validation.pem",
"client_key":"/home/lexx/.chef/user.pem",
"node_name":"user"
},
"vagrant":{
"vm":{
"box":"Centos_chef11",
"box_url":"http://vagrant.server/vagrant_berkshelf.box",
"forward_port":{
},
"network":{
"bridged":false,
"hostonly":"33.33.33.10"
},
"provision":"chef_solo"
}
},
"ssl":{
"verify":true
}
}

Thanks!
Please excuse my bad English.

--
Jamie Winsor
@resetexistence http://twitter.com/resetexistence

--
Jamie Winsor
@resetexistence http://twitter.com/resetexistence

Perfect, thanks for the detailed explanation!

Cheers, Torben

On Mon, Aug 12, 2013 at 10:11 PM, Jamie Winsor jamie@vialstudios.comwrote:

It is pinned by Vagrant-Berkshelf, but it is pinned with a pessimistic
operator (~> 2.0.7). The plugin and Berkshelf are not released in lock step
and Vagrant has it's own gem store that it leverages. This means that the
version of Berkshelf that you install with gem install berkshelf is not
the same gem installation that the Vagrant-Berkshelf plugin is using.

When you install Vagrant-Berkshelf it will also install Berkshelf into
it's own gem store. The easiest way to make sure you have the latest
version of Berkshelf in the gem store is to re-install Vagrant-Berkshelf.
This manner of troubleshooting isn't exactly what we want, so I will bring
up releasing the plugin and Berkshelf in lock step at the next triage
meeting.

You can see what version of Berkshelf the Vagrant-Berkshelf plugin is
using by inspecting Vagrant's gem store (~/.vagrant.d/gems/gems).

On Mon, Aug 12, 2013 at 12:52 PM, Torben Knerr ukio@gmx.de wrote:

Hey Jamie,

how do I know which version of Berkshelf comes with vagrant-berkshelf?

Just wondering since I thought that the Berkshelf version would be pinned
by vagrant-berkshelf...

Cheers,
Torben

On Mon, Aug 12, 2013 at 7:34 PM, Jamie Winsor jamie@vialstudios.comwrote:

Hey Aleksandr,

Looks like you've run into a potential bug with the 2.0.6 release of
Berkshelf. We had similar reports that I know we've definitely fixed in the
master branch and the most current beta release of Berkshelf. We also
released 2.0.8 which may contain the fix to your issue as well.

I would start by re-installing the vagrant-berkshelf plugin to ensure
that it picks up the very latest version of Berkshelf. You can do that with
$ vagrant plugin uninstall vagrant-berkshelf && $ vagrant plugin install vagrant-berkshelf.

If you are still experiencing issues open a ticket on the Berkshelf
issue tracker Sign in to GitHub · GitHub and
we'll help you get it sorted.

note: it's possible to use the beta version of Berkshelf with Vagrant
Berkshelf, but it requires you to jump through a few hoops.

On Mon, Aug 12, 2013 at 8:52 AM, Tim Green tgreen@opscode.com wrote:

Did you try removing the depends line from the metadata.rb? That
shouldn't be required, especially if you're explicitly declaring it in the
Berksfile so that it can be downloaded from your local Chef server.

From: Aleksandr Chumakov lexx@gts.dp.ua
Reply-To: "chef@lists.opscode.com" chef@lists.opscode.com
Date: Monday, August 12, 2013 10:14 AM
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Managing dependencies via Berkshelf

Hi,
I have a question about Berkshelf and dependency management (sorry,
maybe it's silly).
I've written cookbook my_nginx which depends on cookbook nginx that is
located on our production chef-server. I want to use Vagrant + Berkshelf
for testing it.
So i wrote in metadata.rb

depends "nginx"

and in Berksfile

metadata
cookbook 'nginx', chef_api: :config

When i execute berks install, i get cookbook from our Chef server in
~/.berkshelf/cookbooks/nginx-1.7.0. However, when i use vagrant up it
downloads dependency from https://cookbooks.opscode.com/api/v1/ to
~/.berkshelf/default/vagrant/berkshelf-20130812-xxxxx and there are absent
some recipes i need.

What I need to do for downloading dependencies from my Chef server
when i use vagrant?

Additional info:
Vagrant version 1.2.7
Berkshelf (2.0.6)
vagrant-berkshelf (1.3.2)
$ vagrant plugin list
vagrant-berkshelf (1.3.3)
vagrant-omnibus (1.1.0)

My ~/.berkshelf/config.json

{
"chef":{
"chef_server_url":"http://api.chef.organization.com",
"validation_client_name":"chef-validator",
"validation_key_path":"/home/user/.chef/validation.pem",
"client_key":"/home/lexx/.chef/user.pem",
"node_name":"user"
},
"vagrant":{
"vm":{
"box":"Centos_chef11",
"box_url":"http://vagrant.server/vagrant_berkshelf.box",
"forward_port":{
},
"network":{
"bridged":false,
"hostonly":"33.33.33.10"
},
"provision":"chef_solo"
}
},
"ssl":{
"verify":true
}
}

Thanks!
Please excuse my bad English.

--
Jamie Winsor
@resetexistence http://twitter.com/resetexistence

--
Jamie Winsor
@resetexistence http://twitter.com/resetexistence

Thanks, Jamie.
Reinstalling the vagrant-berkshelf plugin resolved my issue.

2013/8/12 Jamie Winsor jamie@vialstudios.com

Hey Aleksandr,

Looks like you've run into a potential bug with the 2.0.6 release of
Berkshelf. We had similar reports that I know we've definitely fixed in the
master branch and the most current beta release of Berkshelf. We also
released 2.0.8 which may contain the fix to your issue as well.

I would start by re-installing the vagrant-berkshelf plugin to ensure that
it picks up the very latest version of Berkshelf. You can do that with $ vagrant plugin uninstall vagrant-berkshelf && $ vagrant plugin install vagrant-berkshelf.

If you are still experiencing issues open a ticket on the Berkshelf issue
tracker Sign in to GitHub · GitHub and we'll help
you get it sorted.

note: it's possible to use the beta version of Berkshelf with Vagrant
Berkshelf, but it requires you to jump through a few hoops.

On Mon, Aug 12, 2013 at 8:52 AM, Tim Green tgreen@opscode.com wrote:

Did you try removing the depends line from the metadata.rb? That
shouldn't be required, especially if you're explicitly declaring it in the
Berksfile so that it can be downloaded from your local Chef server.

From: Aleksandr Chumakov lexx@gts.dp.ua
Reply-To: "chef@lists.opscode.com" chef@lists.opscode.com
Date: Monday, August 12, 2013 10:14 AM
To: "chef@lists.opscode.com" chef@lists.opscode.com
Subject: [chef] Managing dependencies via Berkshelf

Hi,
I have a question about Berkshelf and dependency management (sorry, maybe
it's silly).
I've written cookbook my_nginx which depends on cookbook nginx that is
located on our production chef-server. I want to use Vagrant + Berkshelf
for testing it.
So i wrote in metadata.rb

depends "nginx"

and in Berksfile

metadata
cookbook 'nginx', chef_api: :config

When i execute berks install, i get cookbook from our Chef server in
~/.berkshelf/cookbooks/nginx-1.7.0. However, when i use vagrant up it
downloads dependency from https://cookbooks.opscode.com/api/v1/ to
~/.berkshelf/default/vagrant/berkshelf-20130812-xxxxx and there are absent
some recipes i need.

What I need to do for downloading dependencies from my Chef server when
i use vagrant?

Additional info:
Vagrant version 1.2.7
Berkshelf (2.0.6)
vagrant-berkshelf (1.3.2)
$ vagrant plugin list
vagrant-berkshelf (1.3.3)
vagrant-omnibus (1.1.0)

My ~/.berkshelf/config.json

{
"chef":{
"chef_server_url":"http://api.chef.organization.com",
"validation_client_name":"chef-validator",
"validation_key_path":"/home/user/.chef/validation.pem",
"client_key":"/home/lexx/.chef/user.pem",
"node_name":"user"
},
"vagrant":{
"vm":{
"box":"Centos_chef11",
"box_url":"http://vagrant.server/vagrant_berkshelf.box",
"forward_port":{
},
"network":{
"bridged":false,
"hostonly":"33.33.33.10"
},
"provision":"chef_solo"
}
},
"ssl":{
"verify":true
}
}

Thanks!
Please excuse my bad English.

--
Jamie Winsor
@resetexistence http://twitter.com/resetexistence