Skip to content

Instantly share code, notes, and snippets.

@rombob
Last active December 18, 2015 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rombob/5811844 to your computer and use it in GitHub Desktop.
Save rombob/5811844 to your computer and use it in GitHub Desktop.
init cookbook for preloading package to vagrant cache
# path: cookbooks/couchbase-vagrant-init/recipes/default.rb
ruby_block 'put_downloaded_package_to_cache_folder' do
block do
package_file = '/tmp/vagrant_init/couchbase-server-community_x86_64_2.0.1.deb'
FileUtils.copy(package_file, Chef::Config[:file_cache_path])
FileUtils.chown('vagrant', 'vagrant', package_file, :verbose => true)
end
only_if { (File.exists? '/tmp/vagrant_init/couchbase-server-community_x86_64_2.0.1.deb') && (Dir.exists? Chef::Config[:file_cache_path]) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment