4 Vagrant.configure(2) do |config|
6 # Pick the right distro and bootstrap, default is ubuntu1404
7 distro = ENV['VPP_VAGRANT_DISTRO']
9 config.vm.box = "puppetlabs/centos-7.0-64-nocm"
10 config.vm.provision 'shell', path: 'bootstrap.centos7.sh'
12 config.vm.box = "puppetlabs/ubuntu-14.04-64-nocm"
13 config.vm.provision 'shell', path: 'bootstrap.ubuntu1404.sh'
16 # Add .gnupg dir in so folks can sign patches
17 # Note, as gnupg puts socket files in that dir, we have
18 # to be cautious and make sure we are dealing with a plain file
19 homedir = File.expand_path("~/")
20 Dir["#{homedir}/.gnupg/**/*"].each do |fname|
22 destname = fname.sub(Regexp.escape("#{homedir}/"),'')
23 config.vm.provision "file", source: fname, destination: destname
27 # Copy in the .gitconfig if it exists
28 if File.file?(File.expand_path("~/.gitconfig"))
29 config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
32 # vagrant-cachier caches apt/yum etc to speed subsequent
35 # vagrant plugin install vagrant-cachier
37 if Vagrant.has_plugin?("vagrant-cachier")
38 config.cache.scope = :box
41 # Define some physical ports for your VMs to be used by DPDK
43 if ENV.key?('VPP_VAGRANT_NICS')
44 nics = ENV['VPP_VAGRANT_NICS'].to_i(10)
47 config.vm.network "private_network", type: "dhcp"
50 # use http proxy if avaiable
51 if ENV['http_proxy'] && Vagrant.has_plugin?("vagrant-proxyconf")
52 config.proxy.http = "$http_proxy"
53 config.proxy.https = "$https_proxy"
54 config.proxy.no_proxy = "localhost,127.0.0.1"
57 config.vm.synced_folder "../../", "/vpp", disabled: false
58 config.vm.provider "virtualbox" do |vb|
61 config.vm.provider "vmware_fusion" do |fusion,override|
62 fusion.vmx["memsize"] = "4096"
64 config.vm.provider "vmware_workstation" do |vws,override|
65 vws.vmx["memsize"] = "8192"
66 vws.vmx["numvcpus"] = "4"