If a `name` is specified as an option, it will be used as the id instead
of inferring it from the `guestpath`. If `guestpath` is nil, the `name`
needs to be specified so the folder can be mounted with a name.
This also fixes the synced folder code to allow `guestpath` to be nil.
It was allowed in a previous version for the purpose of preventing a
directory from being auto mounted (#936), but seems to have become an
error at some point after that.
An example of modifying the default /vagrant folder so it doesn't
auto-mount anymore:
config.vm.synced_folder ".", nil, name: "/vagrant"
An example of sharing another folder, but not auto-mounting it:
config.vm.synced_folder ".", nil, name: "foobar"
Fixes#6835.
This adds a new environmental variable `VAGRANT_BOX_UPDATE_CHECK_DISABLE`,
which instructs Vagrant to not check for box updates when running
regular Vagrant commands. This behaves the same as the existing
`config.vm.box_update_check` configuration option, but can be set
globally. Vagrantfile-supplied options will take precedence.
Fixes GH-7479
This adds two new SSH configuration options:
- `keys_only`
- `paranoid`
These values were previously hard-coded, but can now be user-specified.
Fixes GH-4275
Added support for Port forwarding in an IP aliased environment. The change
makes the following forwarding rule(s) possible.
Ex: eth0 is ip aliased to have a range of IP addresses 10.20.30.0/24.
In the Vagrant file, we can now have an entry like the following and
it will just work! Note the host port 8081 is the same for both .1 and .2.
Vagrant.configure("2") do |config|
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 81, host: 8081, host_ip: 10.20.30.1
config.vm.network "forwarded_port", guest: 82, host: 8081, host_ip: 10.20.30.2
end
When the network's type is :dhcp, the :ip option is used to derive the DHCP server configuration, and it doesn't actually indicate the IP that will be received by the VM(s).
If the Vagrantfile has some kind of error, display not only
its path and the exception message, but also the originating
line number and exception class.
Also log the full backtrace when the error is in a provider
block, just as it is done when it's outside a provider block.
@mitchellh this is a partial revert of 84ae22e. It took me a little bit
to figure out why this broke everything, but then I finally realized it.
84ae22e changes the finalize! function to lookup pushes by strategy
type, but pushes are keyed by push strategy name. In other words, given:
config.push.define("foo", strategy: "bar")
the `push_configs` has will look like:
{ :foo => [:bar, #<PushConfig>] }
This is important, because if we key by strategy, the user cannot
specify the same push strategy more than once:
config.push.define("foo", strategy: "bar")
config.push.define("zip", strategy: "bar")
If we keyed off of the strategy, this would be impossible.
This commits adds a new config setting `config.vm.box_server_url` to set
the URL of a local VagrantCloud instance in the Vagrantfile. If the
environment variable `VAGRANT_SERVER_URL` is set, it will still be
preferred.