schisamo/vagrant-omnibus — pull request #71 by tknerr (2014-03-20 20:36:23+00:00)
Title: Cache omnibus download, expose config options

Fixes schisamo/vagrant-omnibus#68

Instead of using an env var the config option `config.omnibus.cache_packages` is introduced. By default it is `true`, so it can be turned off if you don't want the caching behaviour.

Additionally the `config.omnibus.install_url` option has been exposed. The `$OMNIBUS_INSTALL_URL` is still considered, but has lower precedence than the config option.

## cache_packages

Caching kicks in only iff:
* `cache_packages` is truthy
* the vagrant-cachier plugin is present
* the vagrant-cachier plugin has `config.cachier.auto_detect` enabled (which is the default)

If caching kicks in `-d /tmp/vagrant-cache/vagrant_omnibus` will be passed to `install.sh` so this will be the location on the guest to which a) the omnibus package will be downloaded and b) which will be cached by vagrant-cachier.

The config option is truthy. Currently we default to `true`, but if more caching strategies would be implemented in the future it could be `:cachier`, `:something_else` or `:whatever` as well. Only `false` or `nil` will disable the caching behaviour.

## install_script

The precedence is now:
1. try `config.omnibus.install_url` if set
2. try `ENV['OMNIBUS_INSTALL_URL']` if set
3. use default url for install(.sh|.msi)

There is some basic validation in place at install time (didn't change anything here). You can pass in for example:
```ruby
config.omnibus.install_url = 'http://some_path.com/install.sh'
config.omnibus.install_url = 'http://some_path.com/install.msi'
config.omnibus.install_url = '/some/path/on/the/host'
```