Name: vagrant-ghost
Owner: 10up
Description: Vagrant Hosts Updater Plugin
Created: 2015-03-12 23:07:38.0
Updated: 2017-11-25 16:35:08.0
Pushed: 2016-06-14 18:15:46.0
Homepage: null
Size: 25
Language: Ruby
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
You may change the name of the aliases file by setting the hosts_files
configuration option in your Vagrantfile:
config.ghost.hosts_files = "hosts_aliases" # Could be anything, e.g. "hosts", or whatever
This will scan the vagrant directory for any file with the name you configured and will use each line as a URI to add to your hosts file pointing to that vagrant instance.
hosts_files
to change the name of the file that holds aliasesaliases
target the VM's root directoryghost.config.hosts
to set static hosts while pulling dynamic ones from an /aliases
file/config/hosts
and /aliases
to just /**/aliases
/config/hosts
and /aliases
) to rebuild the hosts mapgit checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)This is a fork of vagrant-hostsupdater.