Skip to content
Browse files

Add vagrant config options for NFS

  • Loading branch information...
1 parent c311294 commit 9e651996028b148bfb52270b542b0454b071a2e5 @tofumatt tofumatt committed Jul 19, 2011
Showing with 27 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +16 −1 Vagrantfile
  3. +5 −0 vagrantconfig.yaml
  4. +5 −0 vagrantconfig_local.yaml-dist
View
1 .gitignore
@@ -19,4 +19,5 @@ locale/*
.vagrant
puppet/cache/*
puppet/manifests/build/
+vagrantconfig_local.yaml
docs/_build
View
17 Vagrantfile
@@ -1,3 +1,17 @@
+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
+
Vagrant::Config.run do |config|
config.vm.box = "ubuntu-lucid-32-openldap.box"
@@ -14,7 +28,8 @@ Vagrant::Config.run do |config|
config.ssh.max_tries = 50
config.ssh.timeout = 300
- if RUBY_PLATFORM =~ /mswin(32|64)/
+ # nfs needs to be explicitly enabled to run.
+ if CONF['nfs'] == false or RUBY_PLATFORM =~ /mswin(32|64)/
config.vm.share_folder("v-root", "/home/vagrant/code", ".")
else
config.vm.share_folder("v-root", "/home/vagrant/code", ".", :nfs => true)
View
5 vagrantconfig.yaml
@@ -0,0 +1,5 @@
+# Default config for Vagrant
+#
+# Don't change this; use vagrantconfig_local.yaml to override these settings
+# instead.
+nfs: false
@ozten
Mozilla member
ozten added a note Jul 19, 2011

Well played sir, well played.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
View
5 vagrantconfig_local.yaml-dist
@@ -0,0 +1,5 @@
+# Configuration for Vagrant
+
+# Change to true if you can use nfs; using nfs significantly
+# improves performance.
+nfs: false

0 comments on commit 9e65199

Please sign in to comment.
Something went wrong with that request. Please try again.