From 89efc99248a8290fc7840f012a2ca891253d198d Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Mon, 22 Sep 2014 15:00:28 +0200 Subject: [PATCH] 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 --- README.md | 4 ++++ Vagrantfile | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/README.md b/README.md index b57db9a..0be314a 100644 --- a/README.md +++ b/README.md @@ -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 -------------------- diff --git a/Vagrantfile b/Vagrantfile index c52b629..d3ff318 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -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"