aboutsummaryrefslogtreecommitdiffstats
path: root/vagrant/tests/cFW/Vagrantfile
blob: d02e7d018af1d1e2b34cecd744810db454941208 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "elastic/ubuntu-16.04-x86_64"
  config.vm.hostname = "demo"
  config.vm.provision 'shell', path: 'postinstall.sh'
  config.vm.network :private_network, :ip => "192.168.10.5", :type => :static # unprotected_private_net_cidr
  config.vm.network :private_network, :ip => "192.168.20.5", :type => :static # protected_private_net_cidr
  config.vm.network :private_network, :ip => "10.10.12.5", :type => :static, :netmask => "16" # onap_private_net_cidr

  if ENV['http_proxy'] != nil and ENV['https_proxy'] != nil
    if not Vagrant.has_plugin?('vagrant-proxyconf')
      system 'vagrant plugin install vagrant-proxyconf'
      raise 'vagrant-proxyconf was installed but it requires to execute again'
    end
    config.proxy.http     = ENV['http_proxy'] || ENV['HTTP_PROXY'] || ""
    config.proxy.https    = ENV['https_proxy'] || ENV['HTTPS_PROXY'] || ""
    config.proxy.no_proxy = ENV['NO_PROXY'] || ENV['no_proxy'] || "127.0.0.1,localhost"
    config.proxy.enabled = { docker: false }
  end

  config.vm.provider 'virtualbox' do |v|
    v.customize ["modifyvm", :id, "--memory", 8192]
    v.customize ["modifyvm", :id, "--cpus", 2]
  end
  config.vm.provider 'libvirt' do |v|
    v.memory = 8192
    v.cpus = 2
    v.nested = true
    v.cpu_mode = 'host-passthrough'
  end
end