Merge pull request #7 from fgrehm/7-nfs-support

Support enabling NFS for root cache folder
This commit is contained in:
Fabio Rehm 2013-06-12 09:43:23 -07:00
commit 6b2169f9d6
5 changed files with 16 additions and 2 deletions

View file

@ -1,5 +1,9 @@
## 0.1.1 (unreleased)
IMPROVEMENTS:
- Support enabling NFS for root cache folder. [GH-7]
## 0.1.0 (June 9, 2013)
IMPROVEMENTS:

View file

@ -24,6 +24,8 @@ from within your `Vagrantfile`:
Vagrant.configure("2") do |config|
config.vm.box = 'your-box'
config.cache.auto_detect = true
# If you are using VirtualBox, you might want to enable NFS for shared folders
# config.cache.enable_nfs = true
end
```

View file

@ -9,6 +9,11 @@ Vagrant.configure("2") do |config|
config.cache.scope = :machine
config.cache.auto_detect = true
config.cache.enable_nfs = true
config.vm.provider :virtualbox do |_, vb|
vb.vm.network :private_network, ip: "192.168.50.123"
end
debian_like_configs = lambda do |debian|
debian.vm.provision :shell, inline: '

View file

@ -16,7 +16,8 @@ module VagrantPlugins
FileUtils.mkdir_p(cache_root.to_s) unless cache_root.exist?
env[:machine].config.vm.synced_folder cache_root, '/tmp/vagrant-cache', id: "vagrant-cache"
nfs_flag = env[:machine].config.cache.enable_nfs
env[:machine].config.vm.synced_folder cache_root, '/tmp/vagrant-cache', id: "vagrant-cache", nfs: nfs_flag
@app.call env

View file

@ -1,12 +1,13 @@
module VagrantPlugins
module Cachier
class Config < Vagrant.plugin(2, :config)
attr_accessor :scope, :auto_detect
attr_accessor :scope, :auto_detect, :enable_nfs
attr_reader :buckets
def initialize
@scope = UNSET_VALUE
@auto_detect = UNSET_VALUE
@enable_nfs = UNSET_VALUE
end
def enable(bucket, opts = {})
@ -18,6 +19,7 @@ module VagrantPlugins
@scope = :box if @scope == UNSET_VALUE
@auto_detect = false if @auto_detect == UNSET_VALUE
@enable_nfs = false if @enable_nfs == UNSET_VALUE
@buckets = @buckets ? @buckets.dup : {}
end