3 # SPDX-license-identifier: Apache-2.0
4 ##############################################################################
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
13 :virtualbox => { :name => "elastic/ubuntu-18.04-x86_64", :version=> '20191020.0.0' },
14 :libvirt => { :name => "generic/ubuntu1804", :version=> "1.9.38"}
19 provider = (ENV["VAGRANT_DEFAULT_PROVIDER"] || :libvirt).to_sym
20 puts "[INFO] Provider: #{provider} "
22 if ENV["no_proxy"] != nil or ENV["NO_PROXY"]
23 $no_proxy = ENV["NO_PROXY"] || ENV["no_proxy"] || "127.0.0.1,localhost,192.168.50.63"
24 $subnet = "192.168.121"
25 if provider == :virtualbox
28 # NOTE: This range is based on vagrant-libvirt network definition CIDR 192.168.121.0/27
30 $no_proxy += ",#{$subnet}.#{i}"
34 Vagrant.configure("2") do |config|
35 config.vm.box = box[provider][:name]
36 config.ssh.insert_key = false
37 config.vm.box_version = box[provider][:version]
38 config.vm.provision "file", source: "vm_authorized_keys", destination: "/home/vagrant/.ssh/authorized_keys"
40 config.vm.provision "shell" do |sh|
41 sh.inline = "mkdir -p /root/.ssh; cp /home/vagrant/.ssh/authorized_keys /root/.ssh/authorized_keys"
45 if ENV["http_proxy"] != nil and ENV["https_proxy"] != nil
46 if Vagrant.has_plugin?("vagrant-proxyconf")
47 config.proxy.http = ENV["http_proxy"] || ENV["HTTP_PROXY"] || ""
48 config.proxy.https = ENV["https_proxy"] || ENV["HTTPS_PROXY"] || ""
49 config.proxy.no_proxy = $no_proxy
50 config.proxy.enabled = { docker: false }
53 config.vm.provider "libvirt" do |v|
55 v.cpu_mode = "host-passthrough"
56 v.management_network_address = "192.168.121.0/27"
57 v.random_hostname = true
61 config.vm.define vm_name = "bpa-test-vm" do |config|
62 config.vm.hostname = "master-test"
63 config.vm.network :private_network, :ip => "192.168.50.63", :type => :static, :mac => "080027efab60"
65 config.vm.provider "virtualbox" do |v|
66 v.customize ["modifyvm", :id, "--memory", 16384]
67 v.customize ["modifyvm", :id, "--cpus", 16]
70 config.vm.provider "libvirt" do |v|
77 sync_type = "virtualbox"
78 if provider == :libvirt