This plugin adds an entry to your /etc/hosts file on the host system.
On up, resume and reload commands, it tries to add the information, if its not already existant in your hosts file. If it needs to be added, you will be asked for an administrator password, since it uses sudo to edit the file.
On halt and destroy, those entries will be removed again. By setting the remove_on_suspend option, you can have them removed on suspend, too:
config.hostsupdater.remove_on_suspend = true
$ vagrant plugin install vagrant-multi-hostsupdater
Uninstall it with:
$ vagrant plugin uninstall vagrant-multi-hostsupdater
At the moment, the only things you need, are the hostname and a :private_network network with a fixed ip.
config.vm.network :private_network, ip: "192.168.3.10" config.vm.hostname = "www.testing.de" config.hostsupdater.aliases = ["alias.testing.de", "alias2.somedomain.com"]
This ip and the hostname will be used for the entry in the /etc/hosts file.
- bugfix: Fix additional new lines being added to hosts file (Thanks to vincentmac)
- bugfix: wrong path on Windows systems (Thanks to Im0rtality)
- bugfix: now not trying to remove anything if no machine id is given
- trying to use proper windows hosts file
- using hashed uids now to identify hosts entries (you might need to remove previous hostentries manually)
- fixed removing of host entries
- no sudo, if /etc/hosts is writeable
- option added to not remove hosts on suspend, adding hosts on resume (Thanks to Svelix)
- fixed problem with removing hosts entries on destroy command (Thanks to Andy Bohne)
- added aliases config option to define additional hostnames
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request