# -*- mode: ruby -*-
# vi: set ft=ruby :


configuration = {
  # Generic parameters used across all ONAP components
  'public_net_id'       => '00000000-0000-0000-0000-000000000000',
  'key_name'            => 'ecomp_key',
  'pub_key'             => '',
  'nexus_repo'          => 'https://nexus.onap.org/content/sites/raw',
  'nexus_docker_repo'   => 'nexus3.onap.org:10001',
  'nexus_username'      => 'docker',
  'nexus_password'      => 'docker',
  'dmaap_topic'         => 'AUTO',
  'artifacts_version'   => '1.0.0',
  'docker_version'      => '1.0-STAGING-latest',
  'gerrit_branch'       => 'master',
# Parameters for DCAE instantiation
  'dcae_zone'           => 'iad4',
  'dcae_state'          => 'vi',
  'openstack_tenant_id' => '',
  'openstack_username'  => '',
  'openstack_api_key'   => '',
  'openstack_password'  => '',
  'nexus_repo_root'     => 'https://nexus.onap.org',
  'nexus_url_snapshot'  => 'https://nexus.onap.org/content/repositories/snapshots',
  'gitlab_branch'       => 'master',
  'build_image'         => 'True',
  'pull_docker_image'   => 'True',
  'odl_version'         => '0.5.3-Boron-SR3',
  'clone_repo'          => 'True',
  'compile_repo'        => 'False',
  'enable_oparent'      => 'True'
}


box = {
  :virtualbox => 'ubuntu/trusty64',
  :libvirt => 'sputnik13/trusty64',
  :openstack => nil
}


nodes = [
    {
    :name   => "aai",
    :ips    => ['10.252.0.6', "192.168.50.6"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 4 * 1024,
    :groups => ["individual"],
    :args   => ["aai"]
  },
  {
    :name   => "all-in-one",
    :ips    => ['10.252.0.3', "192.168.50.3"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 12 * 1024,
    :groups => ["all-in-one"],
    :flavor => 'm1.xlarge',
    :args   => ['mr', 'sdc', 'aai', 'mso', 'robot', 'vid', 'sdnc', 'portal', 'dcae', 'policy', 'appc', 'vfc', 'ccsdk'],
  },
  {
    :name   => "appc",
    :ips    => ['10.252.0.14', "192.168.50.14"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 4 * 1024,
    :groups => ["individual"],
    :args   => ["appc"],
  },
  {
    :name   => "ccsdk",
    :ips    => ['10.252.0.14', "192.168.50.17"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 4 * 1024,
    :groups => ["individual"],
    :args   => ["ccsdk"],
  },
  {
    :name   => "dcae",
    :ips    => ['10.252.0.12', "192.168.50.12"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 4 * 1024,
    :groups => ["individual"],
    :args   => ["dcae"],
  },
  {
    :name   => "dns",
    :ips    => ['10.252.0.3', "192.168.50.3"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 1 * 1024,
    :groups => ["individual"],
    :flavor => 'm1.small',
    :args   => [" "]
  },
  {
    :name   => "message-router",
    :ips    => ['10.252.0.4', "192.168.50.4"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 4 * 1024,
    :groups => ["individual"],
    :args   => ["mr"],
  },
  {
    :name   => "mso",
    :ips    => ['10.252.0.7', "192.168.50.7"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 4 * 1024,
    :groups => ["individual"],
    :args   => ["mso"],
  },
  {
    :name   => "multicloud",
    :ips    => ['10.252.0.16', "192.168.50.16"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 4 * 1024,
    :groups => ["individual"],
    :args   => ["multicloud"],
  },
  {
    :name   => "policy",
    :ips    => ['10.252.0.13', "192.168.50.13"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 4 * 1024,
    :groups => ["individual"],
    :args   => ["policy"],
  },
  {
    :name   => "portal",
    :ips    => ['10.252.0.11', "192.168.50.11"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 4 * 1024,
    :groups => ["individual"],
    :args   => ["portal"],
  },
  {
    :name   => "robot",
    :ips    => ['10.252.0.8', "192.168.50.8"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 4 * 1024,
    :groups => ["individual"],
    :args   => ["robot"],
  },
  {
    :name   => "sdc",
    :ips    => ['10.252.0.5', "192.168.50.5"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 8 * 1024,
    :groups => ["individual"],
    :args   => ["sdc"],
  },
  {
    :name   => "sdnc",
    :ips    => ['10.252.0.10', "192.168.50.10"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 4 * 1024,
    :groups => ["individual"],
    :args   => ["sdnc"],
  },
  {
    :name   => "testing",
    :ips    => ['10.252.0.3', "192.168.50.3"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 4 * 1024,
    :groups => ["testing"],
    :flavor => 'm1.small',
    :args   => [""],
  },
  {
    :name   => "vfc",
    :ips    => ['10.252.0.15', "192.168.50.15"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 4 * 1024,
    :groups => ["individual"],
    :args   => ['vfc'],
  },
  {
    :name   => "vid",
    :ips    => ['10.252.0.9', "192.168.50.9"],
    :macs   => [],
    :cpus   => 2,
    :cpu    => "50",
    :ram    => 4 * 1024,
    :groups => ["individual"],
    :args   => ['vid'],
  },
]


run_path   = 'vagrant_utils/postinstall.sh'
sdc_volume = 'vol1-sdc-data.vdi'

Vagrant.require_version ">= 1.8.6"

# Determine the provider used
provider = (ENV['VAGRANT_DEFAULT_PROVIDER'] || :virtualbox).to_sym
puts "[INFO] Provider: #{provider} "

vd_conf = ENV.fetch('VD_CONF', 'etc/settings.yaml')
if File.exist?(vd_conf)
  require 'yaml'
  user_conf = YAML.load_file(vd_conf)
  configuration.update(user_conf)
end

#Set network interface
net_interface = 'vboxnet0'
is_windows = Gem.win_platform?
if is_windows
    net_interface = 'VirtualBox Host-Only Ethernet Adapter #2'
end
puts "[INFO] Net interface: #{net_interface}"


#If argument is given use it. Otherwise use Env: DEPLOY_MODE else use default
requested_machine = ARGV[1]

deploy_mode = ENV.fetch('DEPLOY_MODE', 'individual')
if requested_machine != nil
    if requested_machine.include?("all-in-one") || requested_machine.include?("testing")
        deploy_mode = requested_machine
    end
end

#Catch the status of all machines
if ARGV[0] == 'status' || ARGV[0] == 'destroy'
    deploy_mode = 'NA'
end

puts "[INFO] Deploy Mode:  #{deploy_mode}"

#In case of all-in-one or testing clean the nodes list
case deploy_mode
    when 'all-in-one'
        nodes.select! do |node|
            if node[:name].include?("all-in-one")
              true if node[:name]
            end
        end

    when 'individual'
        nodes.select! do |node|
            if node[:groups][0].include?("individual")
              true if node[:name]
            end
        end

    when 'testing'
        nodes.select! do |node|
            if node[:name].include?("testing")
              true if node[:name]
            end
        end
end

Vagrant.configure("2") do |config|

  # PROXY definitions
    if ENV['http_proxy'] != nil and ENV['https_proxy'] != nil and ENV['no_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']
      config.proxy.https    = ENV['https_proxy']
      config.proxy.no_proxy = ENV['no_proxy']
    end

    if Vagrant.has_plugin?('vagrant-vbguest')
      puts 'vagrant-vbguest auto_update feature will be disable to avoid sharing conflicts'
      config.vbguest.auto_update = false
    end

    if provider == :libvirt
      if not Vagrant.has_plugin?('vagrant-libvirt')
        system 'vagrant plugin install vagrant-libvirt'
        raise 'vagrant-libvirt was installed but it requires to execute again'
      end
    end

    if provider == :openstack
      config.ssh.username = 'ubuntu'
      if not Vagrant.has_plugin?('vagrant-openstack-provider')
        system 'vagrant plugin install vagrant-openstack-provider'
        raise 'vagrant-openstack-provider was installed but it requires to execute again'
      end
    end

    nodes.each do |node|
      config.vm.define node[:name] do |nodeconfig|

        # Common Settings:

        nodeconfig.vm.provider "virtualbox" do |vbox|
          vbox.customize ['modifyvm', :id, '--nictype1', 'virtio']
          vbox.customize ['modifyvm', :id, '--audio', 'none']
          vbox.customize ['modifyvm', :id, '--vram', '1']
          vbox.customize ['modifyvm', :id, "--cpuhotplug", "off"]
          vbox.customize ['modifyvm', :id, "--cpuexecutioncap", node[:cpu]]
          vbox.customize ['modifyvm', :id, "--cpus", node[:cpus]]
          vbox.customize ["modifyvm", :id, "--memory", node[:ram]]
        end

        nodeconfig.vm.provider "libvirt" do |lbox|
          lbox.memory = node[:ram]
          lbox.nested = true
        end

        nodeconfig.vm.provider :openstack do |obox|
          obox.openstack_auth_url               = ENV.fetch('OS_AUTH_URL', '')
          obox.tenant_name                      = ENV.fetch('OS_TENANT_NAME', '')
          obox.username                         = ENV.fetch('OS_USERNAME', '')
          obox.password                         = ENV.fetch('OS_PASSWORD', '')
          obox.region                           = ENV.fetch('OS_REGION_NAME', '')
          obox.identity_api_version             = ENV.fetch('OS_IDENTITY_API_VERSION', '')
          obox.domain_name                      = ENV.fetch('OS_PROJECT_DOMAIN_ID', '')
          obox.project_name                     = ENV.fetch('OS_PROJECT_NAME', '')
          obox.floating_ip_pool                 = ENV.fetch('OS_FLOATING_IP_POOL', '')
          obox.floating_ip_pool_always_allocate = (ENV['OS_FLOATING_IP_ALWAYS_ALLOCATE'] == 'true')
          obox.image                            = ENV.fetch('OS_IMAGE', '')
          obox.security_groups                  = [ENV.fetch('OS_SEC_GROUP', '')]
          obox.networks                         = ENV.fetch('OS_NETWORK', '')
          obox.flavor                           = node[:flavor]
          obox.server_name                      = node[:name]
        end

        # Set Box type
        nodeconfig.vm.box = box[provider]

        # Set Node name
        nodeconfig.vm.hostname = node[:name]

        # Set Sync Folder
        nodeconfig.vm.synced_folder ".", "/vagrant", disabled: true
        nodeconfig.vm.synced_folder './opt', '/opt/', create: true
        nodeconfig.vm.synced_folder './lib', '/var/onap/', create: true
        if !is_windows
          nodeconfig.vm.synced_folder '~/.m2', '/root/.m2/', create: true
        end
        # Set Network
        nodeconfig.vm.network :private_network,
            :adapter => 2,
            :name => net_interface,
            :ip  => node[:ips][0]

        nodeconfig.vm.network :private_network,
            :adapter => 3,
            :ip  => node[:ips][1],
            :type => :static

        # Specific settings:

        #Set Storage (For SDC or All-in-one)
        if node[:name].include?("all-in-one") || node[:name].include?("sdc")
          nodeconfig.vm.provider "virtualbox" do |v|
              unless File.exist?(sdc_volume)
                  v.customize ['createhd', '--filename', sdc_volume, '--size', 20 * 1024]
              end
              v.customize ['storageattach', :id, '--storagectl', 'SATAController', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', sdc_volume]
            end

            nodeconfig.vm.provider "libvirt" do |v|
                v.storage :file, path: sdc_volume, bus: 'sata', device: 'vdb', size: '2G'
            end
        end

        if node[:name].include? "testing"
            nodeconfig.vm.synced_folder './tests', '/var/onap_tests/', create: true
            test_suite = ENV.fetch('TEST_SUITE', '*')
            test_case = ENV.fetch('TEST_CASE', '*')
            # Override variables
            run_path = 'vagrant_utils/unit_testing.sh'
            node[:args] = [test_suite, test_case]
        end


        if node[:name].include? "vfc"
          nodeconfig.vm.provision 'docker'
        end

        nodeconfig.vm.provision 'shell' do |s|
          s.path = run_path
          s.args = node[:args]
          s.env  = configuration
        end

      end #nodeconfig
    end #node
end #config
