scripts/vagrant: unify VM boxes source

Unify all distro selections to use the same generic/* source
for downloading boxes.
"generic/" is provided by Roboxes.

Change-Id: Id5d704e35313c382a564da2a50177766293a88c1
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476160
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Karol Latecki 2019-11-29 13:52:29 +01:00 committed by Tomasz Zawadzki
parent 672c73fb12
commit 4342c0f0d5

View File

@ -8,33 +8,17 @@ Vagrant.configure(2) do |config|
provider = (ENV['SPDK_VAGRANT_PROVIDER'] || "virtualbox") provider = (ENV['SPDK_VAGRANT_PROVIDER'] || "virtualbox")
case distro case distro
when "centos7" when "centos7"
config.vm.box = "puppetlabs/centos-7.2-64-nocm" # See: https://app.vagrantup.com/generic/boxes/centos7
config.ssh.insert_key = false config.vm.box = "generic/centos7"
# Puppetlabs does not provide libvirt Box so we will use official one
config.vm.provider :libvirt do |libvirt|
config.vm.box = "centos/7"
end if Vagrant.has_plugin?('vagrant-libvirt')
when "centos8" when "centos8"
# See: https://app.vagrantup.com/generic/boxes/centos8 # See: https://app.vagrantup.com/generic/boxes/centos8
config.vm.box = "generic/centos8" config.vm.box = "generic/centos8"
when "ubuntu16" when "ubuntu16"
if provider.eql?("libvirt") #See: https://app.vagrantup.com/generic/boxes/ubuntu1604
# https://app.vagrantup.com/sjohnsen/boxes/ubuntu1604 config.vm.box = "generic/ubuntu1604"
config.vm.box = "sjohnsen/ubuntu1604"
else
# See: https://app.vagrantup.com/puppetlabs/boxes/ubuntu-16.04-64-nocm
config.vm.box = "puppetlabs/ubuntu-16.04-64-nocm"
config.vm.box_version = "1.0.0"
end
when "ubuntu18" when "ubuntu18"
if provider.eql?("libvirt") #See: https://app.vagrantup.com/generic/boxes/ubuntu1804
# https://app.vagrantup.com/sjohnsen/boxes/ubuntu1804 config.vm.box = "generic/ubuntu1804"
config.vm.box = "sjohnsen/ubuntu1804"
else
# See: https://app.vagrantup.com/bento/boxes/ubuntu-18.04
config.vm.box = "bento/ubuntu-18.04"
config.vm.box_version = "201803.24.0"
end
when "fedora29" when "fedora29"
#See: https://app.vagrantup.com/generic/boxes/fedora29 #See: https://app.vagrantup.com/generic/boxes/fedora29
config.vm.box = "generic/fedora29" config.vm.box = "generic/fedora29"
@ -91,8 +75,12 @@ Vagrant.configure(2) do |config|
config.cache.scope = :box config.cache.scope = :box
end end
if !(distro.include?("ubuntu")) if (distro.include?("ubuntu"))
# Ubuntu boxes from generic/ubuntuX do not generate /etc/resolv.conf files properly which causes
# DNS to not work. Copy host /etc/resolv.conf file to the VM as a workaround.
config.vm.network "private_network", type: "dhcp" config.vm.network "private_network", type: "dhcp"
config.vm.provision "file", source: "/etc/resolv.conf", destination: "/home/vagrant/resolv.conf"
config.vm.provision "shell", inline: "sudo mv -f /home/vagrant/resolv.conf /etc/resolv.conf"
end end
# use http proxy if avaiable # use http proxy if avaiable