Add suport for vagrant-hostmanager to manage /etc/hosts

At the moment the used hostnames in the configuration file are
maybe not resolvable on the Vagrant instances which will result
in issues (for example the SERVICE_HOST variable in local.conf
used the hostname of the manager node).

The vagrant-hostmanager plugin manages the /etc/hosts file
and will set correct entries there to make the hostnames in the
configuration file resolvable.

Change-Id: I7ecd379c9f7e47c04abc85aa61de9c6c50f8a50b
This commit is contained in:
Christian Berendt
2014-09-22 15:00:28 +02:00
parent c3d5a9214a
commit 89efc99248
2 changed files with 11 additions and 0 deletions

View File

@@ -38,6 +38,10 @@ have enough horsepower you should make the file something like:
You can probably get away with less cpus, and 4096 MB of memory, but
the above is recommended size.
If the used hostnames in the ``config.yaml`` file (variable ``hostname_manager``
and ``hostname_compute``) are not resolvable you have to install the
``vagrant-hostmanager`` plugin (``vagrant plugin install vagrant-hostmanager``).
Local Setup
--------------------

7
Vagrantfile vendored
View File

@@ -89,6 +89,13 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# https://github.com/mitchellh/vagrant/issues/1673
config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
if Vagrant.has_plugin?("vagrant-hostmanager")
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.ignore_private_ip = false
config.hostmanager.include_offline = true
end
config.vm.define "manager" do |manager|
configure_vm("manager", manager.vm, conf)
manager.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"