Skip to content

Instantly share code, notes, and snippets.

@sit
Created May 2, 2013 16:16
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sit/5503323 to your computer and use it in GitHub Desktop.
Save sit/5503323 to your computer and use it in GitHub Desktop.
Vagrant and Berkshelf configuration for migrating a chef-repo into Berkshelf-managed cookbooks. (It appears berkshelf-vagrant does not do this automatically, despite what https://github.com/RiotGames/vagrant-berkshelf/blob/master/lib/berkshelf/vagrant/action.rb#L17 may suggest.)
# -*- mode: ruby -*-
# vi: set ft=ruby :
site :opscode
# Suck in all cookbooks in local chef-repo
Dir.entries("cookbooks").each do |cookbook_name|
next if cookbook_name.starts_with?('.')
cookbook_dir = "cookbooks/#{cookbook_name}"
next unless File.directory?(cookbook_dir)
cookbook cookbook_name, path: cookbook_dir
end
# Add your cookbooks here as per http://berkshelf.com/
# cookbook 'build-essential'
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.berkshelf.enabled = true
config.vm.provision :chef_solo do |chef|
chef.data_bags_path = "data_bags"
chef.roles_path = "roles"
# Set your role or Recipes here as documented at
# http://docs.vagrantup.com/v2/provisioning/chef_solo.html
# chef.add_recipe "build-essential"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment