From 20344e2552dec63efb9d8d226f53e7078156f9e9 Mon Sep 17 00:00:00 2001 From: Bernhard Gschaider Date: Wed, 4 Jun 2014 15:07:25 +0200 Subject: [PATCH] Better hostnames. Got the name of the box and the host-computer. Code duplication. If someone finds out how to do this more elegantly I'll by him a drink of choice --- vagrantSandbox/Vagrantfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vagrantSandbox/Vagrantfile b/vagrantSandbox/Vagrantfile index 8042f9b2f..94e0985c5 100644 --- a/vagrantSandbox/Vagrantfile +++ b/vagrantSandbox/Vagrantfile @@ -4,7 +4,7 @@ Vagrant.configure("2") do |config| config.vm.synced_folder "..", "/FOAM-sources" - config.vm.hostname="vagrant"+ (ENV["HOSTNAME"] || `hostname`.strip) + config.vm.hostname="vagrant."+ (ENV["HOSTNAME"] || `hostname`.strip) nrCPU=1 if ENV["WM_VAGRANT_CPUS"] @@ -36,6 +36,7 @@ Vagrant.configure("2") do |config| s.args = "trusty" s.path = "initUbunutuScript.sh" end + trusty.vm.hostname="trusty."+config.vm.hostname end # default @@ -47,6 +48,7 @@ Vagrant.configure("2") do |config| s.args = "precise" s.path = "initUbunutuScript.sh" end + precise.vm.hostname="precise."+config.vm.hostname end config.vm.define :centos65 do |centos65| @@ -57,6 +59,7 @@ Vagrant.configure("2") do |config| s.args = "centos65" s.path = "initCentOSRHELScript.sh" end + centos65.vm.hostname="centos65."+config.vm.hostname end # legacy @@ -67,6 +70,7 @@ Vagrant.configure("2") do |config| s.args = "lucid" s.path = "initUbunutuScript.sh" end + lucid.vm.hostname="lucid."+config.vm.hostname end #legacy @@ -77,6 +81,7 @@ Vagrant.configure("2") do |config| s.args = "lucid" s.path = "initUbunutuScript.sh" end + maverick.vm.hostname="maverick."+config.vm.hostname end # experimental @@ -91,6 +96,7 @@ Vagrant.configure("2") do |config| end freebsd92.vm.synced_folder "..", "/FOAM-sources", type: "rsync", rsync__exclude: "vagrantSandbox/" freebsd92.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: "ccache4vm/" + freebsd92.vm.hostname="freebsd92."+config.vm.hostname end # legacy/experimental @@ -112,6 +118,8 @@ Vagrant.configure("2") do |config| # use NFS for the synced folder freebsd10.vm.synced_folder "..", "/FOAM-sources", :nfs => true + + freebsd10.vm.hostname="freebsd10."+config.vm.hostname end # legacy @@ -122,6 +130,7 @@ Vagrant.configure("2") do |config| s.args = "opensuse12" s.path = "initOpenSUSEScript.sh" end + opensuse12.vm.hostname="opensuse12."+config.vm.hostname end end