Put the right hostname in /etc/hosts

This commit is contained in:
Michael Schurter 2017-01-12 16:57:09 -08:00 committed by GitHub
parent abfc502e49
commit a27306ed39
1 changed files with 1 additions and 1 deletions

2
Vagrantfile vendored
View File

@ -65,7 +65,7 @@ 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
sudo sed -i -e "s/.*nomad.*/$(ip route get 1 | awk '{print $NF;exit}') $(hostname)/" /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