Skip to content

Instantly share code, notes, and snippets.

@bennylope
Created October 19, 2012 15:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bennylope/3918879 to your computer and use it in GitHub Desktop.
Save bennylope/3918879 to your computer and use it in GitHub Desktop.
if CONF.has_key?("mounts")
CONF['mounts'].each do |folder|
config.vm.share_folder(folder['name'], folder['virtual'], folder['host'], :nfs => true)
end
end
nfs: true
mounts:
- name: "code"
virtual: "/var/code"
host: "~/Code"
require "yaml"
# Load up our vagrant config files -- vagrantconfig.yaml first
_config = YAML.load(File.open(File.join(File.dirname(__FILE__),
"vagrantconfig.yaml"), File::RDONLY).read)
# Local-specific/not-git-managed config -- vagrantconfig_local.yaml
begin
_config.merge!(YAML.load(File.open(File.join(File.dirname(__FILE__),
"vagrantconfig_local.yaml"), File::RDONLY).read))
rescue Errno::ENOENT # No vagrantconfig_local.yaml found -- that's OK; just
# use the defaults.
end
CONF = _config
MOUNT_POINT = '/var/apps/myapp/source'
Vagrant::Config.run do |config|
# Box set up stuff removed
if CONF['nfs'] == false or RUBY_PLATFORM =~ /mswin(32|64)/
nfs = false
end
config.vm.share_folder("app_root", MOUNT_POINT, ".", :nfs => nfs)
if CONF.has_key?("mounts")
CONF['mounts'].each do |folder|
config.vm.share_folder(folder['name'], folder['virtual'], folder['host'], :nfs => true)
end
end
# Provisioning removed
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment