vagrant-hostsupdater
vagrant-hostsupdater copied to clipboard
Off By Default
Currently, this plugin "activates" if two standard config options.
In the case where I want the hosts file managed for one vagrant machine, I must alter the configurations for all other vagrant machines to avoid hosts file management.
I would like to see this plugin require a plugin-specific configuration flag to be turned on. For example:
config.hostsupdater.manage_hosts = true
This would make the plugin far less aggressive and would avoid users from scratching their head when they install a new box and forget about adding the "skip" parameter to their networking config.
This would also make it easy to temporarily disable the plugin in cases where there are multiple network configurations. (The alternative is altering every private network address.)
Note, that when this flag is disabled, the plugin should still perform clean up operations on the hosts file.
@crussell52 I do like this idea of having the plugin off by default - most other plugins have a mechanism to enable it. You bring up a good example of editing multiple VagrantFiles just to turn the plugin off. Where as you'd edit a few to turn the plugin on.
This would be a pretty major BC break though.
what happens if the plugin is not installed and you got config.hostsupdater.manage_hosts = true in the Vagrantfile?
❱ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:
VagrantPlugins::HostsUpdater::Config:
* The following settings shouldn't exist: manage_hosts
users would have to install the plugin - what in this case is completely irrelevant/optional for operation of the guest machine - or remove the entry to be able to get the guest machine up and running.
so personally i like the fact that i don't need to modify my guest machine Vagrantfile to update my host machine hosts file or not.
what could be nice tough:
vagrant up --disable-plugin=vagrant-hostsupdater
@oskude you can always wrap the VagrantFile with this:
if Vagrant.has_plugin?("vagrant-hostsupdater")
config.hostsupdater.manage_hosts = true
# other vagrant-hostsupdater options
end