10up/varying-vagrant-vagrants — pull request #168 by simonwheatley (2013-09-29 08:49:53+00:00)
Title: Include Vagrant hosts in host machine hosts file using hosts updater

(Quite pleased with how many times I got the word host in the title of the PR.)

This shows one answer to this comment in `Vagrantfile`:

> A short term goal is to read [the hosts] in from a local config file so that they can be more dynamic to your setup.

The code assumes there may be a `hosts.dat` file in a `data` folder of each subfolder of `/src/www/`, e.g. `/srv/www/mydevsite/data/hosts.dat`. The `hosts.dat` file is expected to contain just a comma separated string of host names to add to the various hosts files.

There's two sections of code, currently:

1. The Ruby in the `Vagrantfile`, which reads the `hosts.dat` files, gathers all the hosts in an array and passes them to the Hosts Updater plugin to add to the host machine.
2. The addition to `Provision.sh`, which reads the `hosts.dat` files, and adds them in turn to the Vagrant's `/etc/hosts` file.