10up/vagrant-ghost

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Vagrant::Ghost

Gem Version

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.

Installation
$ vagrant plugin install vagrant-ghost

Uninstall it with:

$ vagrant plugin uninstall vagrant-ghost
Usage

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.

Changelog
0.2.3
0.2.2
0.2.1
0.2.0
0.1.3
0.1.2
0.1.1
0.1.0
Contributing
  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Credits

This is a fork of vagrant-hostsupdater.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.