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

Vagrant.configure("2") do |config|
  config.vm.provider :virtualbox do |provider|
    # set unique vm name
    provider.name = VM_NAME
    provider.memory = get_env_var_rb("RAMSIZE")
    box = "terminal-labs/tl-" + get_env_var_rb("GUEST_OS") + "-64bit-" + get_env_var_rb("DRIVESIZE") + 'gb'
    config.vm.box = box
    config.vm.box_url = box

    provider.customize ['modifyvm', :id, '--nictype1', 'virtio']
    provider.customize ['modifyvm', :id, '--nictype2', 'virtio']
  end
  config.ssh.username = "vagrant"
  config.ssh.forward_agent = FORWARD_SSH
  if get_env_var_rb("GUEST_OS") != "centos-7"
    config.vm.hostname = VM_NAME
  end
  config.vm.network :forwarded_port,
    :guest => 5000,
    :host => 5000,
    auto_correct: true
  config.vm.network :forwarded_port,
    :guest => 8080,
    :host => 8080,
    auto_correct: true
  config.vm.network :private_network,
    ip: "192.168.33.10"
end
