Add support for using NFS for root cache folder

This commit is contained in:
Fabio Rehm 2013-06-11 20:16:06 -03:00
parent df79d420c5
commit bbdbc5beba
4 changed files with 14 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

@ -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