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

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.ssh.insert_key = false

  # Centos-7.4 builder host
  config.vm.define "centosbuilder" do |builder|
    builder.vm.hostname = "centosbuilder.dev"
    builder.vm.box = "centos/7"
    builder.vm.synced_folder "../../", "/git/ovs", type: "rsync",
                             rsync__args: ["--archive", "--delete", "-z"]
    builder.vm.provision "builder", type: "ansible" do |ansible|
      ansible.playbook = "../playbook-centos-builder.yml"
      ansible.sudo = true
    end
  end

  # Ubuntu-16.04 builder host
  config.vm.define "ubuntubuilder" do |builder|
    builder.vm.hostname = "ubuntubuilder.dev"
    builder.vm.box = "generic/ubuntu1604"
    builder.vm.synced_folder "../../", "/git/ovs", type: "rsync",
                             rsync__args: ["--archive", "--delete", "-z"]
    builder.vm.provision "builder", type: "ansible" do |ansible|
      ansible.playbook = "../playbook-ubuntu-builder.yml"
      ansible.sudo = true
    end
  end

  # Fedora builder host
  config.vm.define "fedorabuilder" do |builder|
    builder.vm.hostname = "fedoraubuilder.dev"
    builder.vm.box = "fedora/27-cloud-base"
    builder.vm.synced_folder "../../", "/git/ovs", type: "rsync",
                             rsync__args: ["--archive", "--delete", "-z"]
    builder.vm.provision "builder", type: "ansible" do |ansible|
      ansible.playbook = "../playbook-fedora-builder.yml"
      ansible.sudo = true
    end
  end

end
