Merge pull request #7 from fgrehm/7-nfs-support
Support enabling NFS for root cache folder
This commit is contained in:
commit
6b2169f9d6
5 changed files with 16 additions and 2 deletions
|
@ -1,5 +1,9 @@
|
||||||
## 0.1.1 (unreleased)
|
## 0.1.1 (unreleased)
|
||||||
|
|
||||||
|
IMPROVEMENTS:
|
||||||
|
|
||||||
|
- Support enabling NFS for root cache folder. [GH-7]
|
||||||
|
|
||||||
## 0.1.0 (June 9, 2013)
|
## 0.1.0 (June 9, 2013)
|
||||||
|
|
||||||
IMPROVEMENTS:
|
IMPROVEMENTS:
|
||||||
|
|
|
@ -24,6 +24,8 @@ from within your `Vagrantfile`:
|
||||||
Vagrant.configure("2") do |config|
|
Vagrant.configure("2") do |config|
|
||||||
config.vm.box = 'your-box'
|
config.vm.box = 'your-box'
|
||||||
config.cache.auto_detect = true
|
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
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
5
development/Vagrantfile
vendored
5
development/Vagrantfile
vendored
|
@ -9,6 +9,11 @@ Vagrant.configure("2") do |config|
|
||||||
|
|
||||||
config.cache.scope = :machine
|
config.cache.scope = :machine
|
||||||
config.cache.auto_detect = true
|
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_like_configs = lambda do |debian|
|
||||||
debian.vm.provision :shell, inline: '
|
debian.vm.provision :shell, inline: '
|
||||||
|
|
|
@ -16,7 +16,8 @@ module VagrantPlugins
|
||||||
|
|
||||||
FileUtils.mkdir_p(cache_root.to_s) unless cache_root.exist?
|
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
|
@app.call env
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module Cachier
|
module Cachier
|
||||||
class Config < Vagrant.plugin(2, :config)
|
class Config < Vagrant.plugin(2, :config)
|
||||||
attr_accessor :scope, :auto_detect
|
attr_accessor :scope, :auto_detect, :enable_nfs
|
||||||
attr_reader :buckets
|
attr_reader :buckets
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@scope = UNSET_VALUE
|
@scope = UNSET_VALUE
|
||||||
@auto_detect = UNSET_VALUE
|
@auto_detect = UNSET_VALUE
|
||||||
|
@enable_nfs = UNSET_VALUE
|
||||||
end
|
end
|
||||||
|
|
||||||
def enable(bucket, opts = {})
|
def enable(bucket, opts = {})
|
||||||
|
@ -18,6 +19,7 @@ module VagrantPlugins
|
||||||
|
|
||||||
@scope = :box if @scope == UNSET_VALUE
|
@scope = :box if @scope == UNSET_VALUE
|
||||||
@auto_detect = false if @auto_detect == UNSET_VALUE
|
@auto_detect = false if @auto_detect == UNSET_VALUE
|
||||||
|
@enable_nfs = false if @enable_nfs == UNSET_VALUE
|
||||||
@buckets = @buckets ? @buckets.dup : {}
|
@buckets = @buckets ? @buckets.dup : {}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue