Skip to content

Instantly share code, notes, and snippets.

@wwestenbrink
Last active December 25, 2015 03:59
Show Gist options
  • Save wwestenbrink/6913828 to your computer and use it in GitHub Desktop.
Save wwestenbrink/6913828 to your computer and use it in GitHub Desktop.
Rake tasks to work around a bug in berkshelf that destroys the vagrant shared NFS folder when installing cookbooks. Use with vagrant chef-solo provisioner. It assumes your cookbook is in the folder app-cookbook/, uses vendor/berkshelf to install & vendor/cookbooks to rsync them.
desc 'Install cookbooks'
task 'cookbooks-install' do
system 'berks install -b app-cookbook/Berksfile -p vendor/berkshelf/'
system 'rsync -aW --delete vendor/berkshelf/* vendor/cookbooks/'
end
desc 'Bring up vagrant virtual machine'
task 'up' => 'cookbooks-install' do
system 'vagrant up'
end
desc 'Bring up vagrant virtual machine using vmware_fusion provider'
task 'vmware-up' => 'cookbooks-install' do
system 'vagrant up --provider=vmware_fusion'
end
desc 'Provision vagrant virtual machine'
task 'provision' => 'cookbooks-install' do
system 'vagrant provision'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment