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

This commit is contained in:
Bernhard Gschaider 2014-06-04 15:07:25 +02:00
parent 19fa6e547e
commit 20344e2552

View file

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