From dc3a013becae5922e16211f8051fb1a1ba0e2b32 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Thu, 12 Jan 2017 11:53:24 -0800 Subject: [PATCH] Add local hostname resolution to Vagrantfile Makes running agents in vagrant without using `-dev` work. --- Vagrantfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index 7412e0412..22a2b33be 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -64,6 +64,9 @@ bash scripts/install_rkt_vagrant.sh bash scripts/install_consul.sh bash scripts/install_vault.sh +# Set hostname's IP to made advertisement Just Work +sudo sed -i -e "s/.*nomad.*/$(ip route get 1 | awk '{print $NF;exit}') nomad/" /etc/hosts + # CD into the nomad working directory when we login to the VM grep "cd /opt/gopath/src/github.com/hashicorp/nomad" ~/.profile || echo "cd /opt/gopath/src/github.com/hashicorp/nomad" >> ~/.profile SCRIPT