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

# Look at the command line arguments and the environment to
# determine the provider being used
if ARGV[1] and (ARGV[1].split('=')[0] == "--provider" or ARGV[2])
  provider = (ARGV[1].split('=')[1] || ARGV[2])
else
  provider = (ENV['VAGRANT_DEFAULT_PROVIDER'] || :virtualbox).to_sym
end

Vagrant.configure(2) do |config|

  if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
    config.vm.synced_folder "..", "/cord", mount_options: ["dmode=700,fmode=600"]
  else
    config.vm.synced_folder "..", "/cord"
  end

  config.vm.define "corddev" do |d|
    d.ssh.forward_agent = true
    d.vm.box = "ubuntu/trusty64"
    d.vm.hostname = "corddev"
    d.vm.network "private_network", ip: "10.100.198.200"
    d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
    d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
    d.vm.provider "virtualbox" do |v|
      v.memory = 2048
    end

    # The libvirt provider is not handling mounts "normally", so for now get the source into the VM
    # via an rsync
    if provider == "libvirt"
      d.vm.synced_folder '../', '/cord', type: 'rsync', rsync__args: ["--verbose", "--archive", "--delete", "-z"]
      d.vm.synced_folder '.', '/vagrant', type: 'rsync', disabled: true
      d.vm.provider :libvirt do |domain|
        domain.memory = 2048
      end
    end
  end

  config.vm.define "prod" do |d|
    d.vm.box = "ubuntu/trusty64"
    d.vm.synced_folder '.', '/vagrant', disable: true
    d.vm.hostname = "prod"
    d.vm.network "private_network", ip: "10.100.198.201"
    d.vm.network "private_network", ip: "0.0.0.0", virtualbox__intnet: "cord-test-network"
    d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
    d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/prod.yml -c local"
    d.vm.provider "virtualbox" do |v|
      v.memory = 2048
    end
  end

  config.vm.define "switch" do |s|
    s.vm.box = "ubuntu/trusty64"
    s.vm.hostname = "fakeswitch"
    s.vm.network "private_network", ip: "10.100.198.253"
    s.vm.network "private_network",
        type: "dhcp",
        virtualbox__intnet: "cord-test-network",
        mac: "cc37ab000001"
    s.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
    s.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/fakeswitch.yml -c local"
    s.vm.provider "virtualbox" do |v|
      v.memory = 1048
      v.name = "fakeswitch"
    end
  end

  config.vm.define "testbox" do |d|
    d.vm.box = "fgrehm/trusty64-lxc"
    d.ssh.forward_agent = true
    d.vm.hostname = "testbox"
    d.vm.network "private_network", ip: "10.0.3.100", lxc__bridge_name: 'lxcbr0'
    d.vm.provision :shell, path: "scripts/bootstrap_ansible.sh"
    d.vm.provision :shell, inline: "PYTHONUNBUFFERED=1 ansible-playbook /cord/build/ansible/corddev.yml -c local"
    config.vm.provider :lxc do |lxc|
        # Same effect as 'customize ["modifyvm", :id, "--memory", "1024"]' for VirtualBox
        lxc.customize 'cgroup.memory.limit_in_bytes', '2048M'
        lxc.customize 'aa_profile', 'unconfined'
        lxc.customize 'cgroup.devices.allow', 'b 7:* rwm'
        lxc.customize 'cgroup.devices.allow', 'c 10:237 rwm'
    end
  end

  (1..3).each do |i|
    # Defining VM properties
    config.vm.define "compute_node#{i}" do |c|
      c.vm.box = "clink15/pxe"
      c.vm.synced_folder '.', '/vagrant', disable: true
      c.vm.communicator = "none"
      c.vm.hostname = "computenode"
      c.vm.network "private_network",
        adapter: "1",
        type: "dhcp",
        auto_config: false,
        virtualbox__intnet: "cord-test-network"
      c.vm.provider "virtualbox" do |v|
        v.name = "compute_node#{i}"
        v.memory = 1048
        v.gui = "true"
      end
    end
  end

  # Libvirt compute node
  # Not able to merge with virtualbox config for compute nodes above
  # Issue is that here no box and no private network are specified
  config.vm.define "compute_node" do |c|
    c.vm.synced_folder '.', '/vagrant', disable: true
    c.vm.communicator = "none"
    c.vm.hostname = "computenode"
    c.vm.network "public_network",
      adapter: 1,
      auto_config: false,
      dev: "mgmtbr",
      mode: "bridge",
      type: "bridge"
    c.vm.provider :libvirt do |domain|
      domain.memory = 8192
      domain.cpus = 4
      domain.machine_virtual_size = 100
      domain.storage :file, :size => '100G', :type => 'qcow2'
      domain.boot 'network'
      domain.boot 'hd'
      domain.nested = true
    end
  end

  if Vagrant.has_plugin?("vagrant-cachier")
    config.cache.scope = :box
  end

end
