Update docs to reflect what's going to be implemented

This commit is contained in:
Fabio Rehm 2014-01-31 23:02:11 -02:00
parent ed6c76dedf
commit 9c7b02b3ac
3 changed files with 59 additions and 10 deletions

View file

@ -24,11 +24,21 @@ from within your `Vagrantfile`:
Vagrant.configure("2") do |config|
config.vm.box = 'your-box'
if Vagrant.has_plugin?("vagrant-cachier")
# Enable cache buckets auto detection
config.cache.auto_detect = true
# If you are using VirtualBox, you might want to enable NFS for shared folders
# config.cache.enable_nfs = true
# You can pass extra mount options, for example:
# config.cache.sync_opts = {:create = true}
# If you are using VirtualBox, you might want to use that to enable NFS for
# shared folders. This is also very useful for vagrant-libvirt if you want
# bi-directional sync
config.cache.synced_folder_opts = {
type: 'nfs',
# The nolock option can be useful for an NFSv3 client that wants to avoid the
# NLM sideband protocol. Without this option, apt-get might hang if it tries
# to lock files needed for /var/cache/* operations. All of this can be avoided
# by using NFSv4 everywhere. Please note that the tcp option is not the default.
mount_options = ['rw', 'vers=3', 'tcp', 'nolock']
}
# For more information please check http://docs.vagrantup.com/v2/synced-folders/basic_usage.html
end
end
```
@ -43,6 +53,7 @@ http://fgrehm.viewdocs.io/vagrant-cachier.
* [vagrant-lxc](https://github.com/fgrehm/vagrant-lxc)
* [VMware providers](http://www.vagrantup.com/vmware) with NFS enabled (See
[GH-24](https://github.com/fgrehm/vagrant-cachier/issues/24) for more info)
* [vagrant-libvirt](https://github.com/pradels/vagrant-libvirt)
## Contributing

View file

@ -24,9 +24,24 @@ from within your `Vagrantfile`:
Vagrant.configure("2") do |config|
config.vm.box = 'your-box'
if Vagrant.has_plugin?("vagrant-cachier")
# Enable cache buckets auto detection
config.cache.auto_detect = true
# If you are using VirtualBox, you might want to enable NFS for shared folders
# config.cache.enable_nfs = true
# You can pass in extra mount options for your cache buckets
# from http://docs.vagrantup.com/v2/synced-folders/basic_usage.html
config.cache.synced_folder_opts = { create: true }
# If you are using VirtualBox, you might want to use that to enable NFS for
# shared folders. This is also very useful for vagrant-libvirt if you want
# bi-directional sync
config.cache.synced_folder_opts = {
type: 'nfs',
# The nolock option can be useful for an NFSv3 client that wants to avoid the
# NLM sideband protocol. Without this option, apt-get might hang if it tries
# to lock files needed for /var/cache/* operations. All of this can be avoided
# by using NFSv4 everywhere. Please note that the tcp option is not the default.
mount_options = ['rw', 'vers=3', 'tcp', 'nolock']
}
end
end
```
@ -40,6 +55,7 @@ For more information please check out the links on the menu above.
* [vagrant-lxc](https://github.com/fgrehm/vagrant-lxc)
* [VMware providers](http://www.vagrantup.com/vmware) with NFS enabled (See
[GH-24](https://github.com/fgrehm/vagrant-cachier/issues/24) for more info)
* [vagrant-libvirt](https://github.com/pradels/vagrant-libvirt)
## Contributing

View file

@ -4,9 +4,9 @@
This is the easiest way to get started with plugin. By adding the code below to
your `Vagrantfile` you can enable automatic detection of supported cache _buckets_.
It is a good practise to wrap plugin specific configuration with `has_plugin?` checks
so the user's Vagrantfiles do not break if plugin is uninstalled or Vagrantfile shared
with people not having the plugin installed.
It is a good practice to wrap plugin specific configuration with `has_plugin?` checks
so the user's Vagrantfiles do not break if vagrant-cachier is uninstalled or
the Vagrantfile is shared with people that do not have the plugin installed.
```ruby
Vagrant.configure("2") do |config|
@ -17,7 +17,7 @@ Vagrant.configure("2") do |config|
end
```
This will make vagrant-cachier do its best to find out what is supported on the
This will make `vagrant-cachier` do its best to find out what is supported on the
guest machine and will set buckets accordingly.
## Enable buckets as needed
@ -35,6 +35,28 @@ end
_Please refer to the "Available Buckets" menu above to find out which buckets
are supported._
## Custom cache buckets synced folders options
For fine grained control over the cache bucket synced folder options you can use
the `synced_folder_opts` config. That's useful if, for example, you are using
VirtualBox and want to enable NFS for improved performance:
```ruby
Vagrant.configure("2") do |config|
config.cache.synced_folder_opts = {
type: 'nfs',
# The nolock option can be useful for an NFSv3 client that wants to avoid the
# NLM sideband protocol. Without this option, apt-get might hang if it tries
# to lock files needed for /var/cache/* operations. All of this can be avoided
# by using NFSv4 everywhere. Please note that the tcp option is not the default.
mount_options = ['rw', 'vers=3', 'tcp', 'nolock']
}
end
```
Please referer to http://docs.vagrantup.com/v2/synced-folders/basic_usage.html for
more information about the supported parameters.
## Cache scope
By default downloaded packages will get stored on a folder scoped to base boxes