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 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, destroy, and suspend those entries will be removed again.
$ vagrant plugin install vagrant-ghost
Uninstall it with:
$ vagrant plugin uninstall vagrant-ghost
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.ghost.hosts = ["alias.testing.de", "alias2.somedomain.com"]
This ip and the hostname will be used for the entry in the /etc/hosts file.
Additional aliases can be added by creating an /aliases
file at the root of the Vagrant machine installation with one host alias per line. This file will be re-imported whenever Vagrant Ghost updates the hostsfile.
- Make the search for
aliases
target the VM's root directory
- Use
ghost.config.hosts
to set static hosts while pulling dynamic ones from an/aliases
file - Update documentation
- Consolidate
/config/hosts
and/aliases
to just/**/aliases
- Make the CLI command scan a local hosts setup files (
/config/hosts
and/aliases
) to rebuild the hosts map
- Update the CLI to a "primary" command
- Make sure help doesn't try to fire a host update
- Initial release
- 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
This is a fork of vagrant-hostsupdater.