Add local hostname resolution to Vagrantfile

Makes running agents in vagrant without using `-dev` work.
This commit is contained in:
Michael Schurter 2017-01-12 11:53:24 -08:00 committed by GitHub
parent a616e9d970
commit 9154f8a8ce
1 changed files with 3 additions and 0 deletions

3
Vagrantfile vendored
View File

@ -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