Skip to content

Instantly share code, notes, and snippets.

@lo5an
Last active August 29, 2015 14:17
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 lo5an/9163ee4fb2d82b873940 to your computer and use it in GitHub Desktop.
Save lo5an/9163ee4fb2d82b873940 to your computer and use it in GitHub Desktop.
~/vagrant.d/Vagrantfile to add package caching and dns for all vms
Vagrant.configure(2) do |config|
# configure a private network so that we can use NFS with caching
config.vm.network "private_network", type: "dhcp"
if Vagrant.has_plugin?("vagrant-cachier")
# Configure cached packages to be shared between instances of the same base box.
# More info on http://fgrehm.viewdocs.io/vagrant-cachier/usage
config.cache.scope = :box
# OPTIONAL: If you are using VirtualBox, you might want to use that to enable
# NFS for shared folders. This is also very useful for vagrant-libvirt if you
# want bi-directional sync
config.cache.synced_folder_opts = {
type: :nfs,
# The nolock option can be useful for an NFSv3 client that wants to avoid the
# NLM sideband protocol. Without this option, apt-get might hang if it tries
# to lock files needed for /var/cache/* operations. All of this can be avoided
# by using NFSv4 everywhere. Please note that the tcp option is not the default.
mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
}
# For more information please check http://docs.vagrantup.com/v2/synced-folders/basic_usage.html
end
# Configure landrush DNS stuff so that we can use $hostname.vm to refer to vms
if Vagrant.has_plugin?("landrush")
config.landrush.enabled = true
config.landrush.tld = 'vm'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment