Vagrantfile for Berkshelf that works w/ solo or client and reads your knife.rb

Hi all,

I wanted to make a general Vagrantfile for Berkshelf cookbooks that you
could provision in solo or w/ chef-client. I also wanted it to just read my
chef-client configuration from knife.rb. That turned into a wild dance of
gem dependency incompatibilities. I made a gist with my Vagrantfile and
Gemfile so no one else has to figure it out.

Hope someone finds this useful.

-Kevin

Hey Kevin,

There's a class in Berkshelf for loading Chef's config without loading Chef as a dependency. You can see it here: https://github.com/RiotGames/berkshelf/blob/master/lib/berkshelf/chef/config.rb

It's not a complete 1-1 mapping but it hits the common things that people access in the config.

Jamie Winsor
@resetexistence

On Mar 15, 2013, at 10:01 AM, Kevin Nuckolls kevin.nuckolls@gmail.com wrote:

Hi all,

I wanted to make a general Vagrantfile for Berkshelf cookbooks that you could provision in solo or w/ chef-client. I also wanted it to just read my chef-client configuration from knife.rb. That turned into a wild dance of gem dependency incompatibilities. I made a gist with my Vagrantfile and Gemfile so no one else has to figure it out.

https://gist.github.com/knuckolls/5171277

Hope someone finds this useful.

-Kevin

Awesome. That's quite helpful. I'll play with this and update the gist.

Thanks!
-Kevin

On Fri, Mar 15, 2013 at 12:27 PM, Jamie Winsor jamie@vialstudios.comwrote:

Hey Kevin,

There's a class in Berkshelf for loading Chef's config without loading
Chef as a dependency. You can see it here:
https://github.com/RiotGames/berkshelf/blob/master/lib/berkshelf/chef/config.rb

It's not a complete 1-1 mapping but it hits the common things that people
access in the config.

Jamie Winsor
@resetexistence

On Mar 15, 2013, at 10:01 AM, Kevin Nuckolls kevin.nuckolls@gmail.com
wrote:

Hi all,

I wanted to make a general Vagrantfile for Berkshelf cookbooks that you
could provision in solo or w/ chef-client. I also wanted it to just read my
chef-client configuration from knife.rb. That turned into a wild dance of
gem dependency incompatibilities. I made a gist with my Vagrantfile and
Gemfile so no one else has to figure it out.

https://gist.github.com/knuckolls/5171277

Hope someone finds this useful.

-Kevin

I can't seem to figure out how to get this to work with the new Vagrant 1.1
berkshelf-vagrant plugin. Anyone have sample usage they can gist?

Thanks,
-Kevin

On Fri, Mar 15, 2013 at 12:28 PM, Kevin Nuckolls
kevin.nuckolls@gmail.comwrote:

Awesome. That's quite helpful. I'll play with this and update the gist.

Thanks!
-Kevin

On Fri, Mar 15, 2013 at 12:27 PM, Jamie Winsor jamie@vialstudios.comwrote:

Hey Kevin,

There's a class in Berkshelf for loading Chef's config without loading
Chef as a dependency. You can see it here:
https://github.com/RiotGames/berkshelf/blob/master/lib/berkshelf/chef/config.rb

It's not a complete 1-1 mapping but it hits the common things that people
access in the config.

Jamie Winsor
@resetexistence

On Mar 15, 2013, at 10:01 AM, Kevin Nuckolls kevin.nuckolls@gmail.com
wrote:

Hi all,

I wanted to make a general Vagrantfile for Berkshelf cookbooks that you
could provision in solo or w/ chef-client. I also wanted it to just read my
chef-client configuration from knife.rb. That turned into a wild dance of
gem dependency incompatibilities. I made a gist with my Vagrantfile and
Gemfile so no one else has to figure it out.

https://gist.github.com/knuckolls/5171277

Hope someone finds this useful.

-Kevin