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

# This Vagrantfile is used for testing the installer. It creates 3 servers
# with a vanilla ubutu server image on it.
require 'yaml'

# Load the settings which are tweaked by the installer to avoid naming conflicts
settings = YAML.load_file 'settings.vagrant.yaml'

Vagrant.configure(2) do |config|
  config.vm.synced_folder ".", "/vagrant", disabled: true
  (1..3).each do |i|
    config.vm.define "#{settings['server_name']}#{i}" do |d|
      d.ssh.forward_agent = true
      d.vm.box = settings["box_source"]
      d.vm.hostname = "#{settings['server_name']}#{i}"
      d.vm.provision :shell, inline: "apt-get -y install python"
      d.vm.provider "libvirt" do |v|
        v.memory = 6144
      end
    end
  end

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

end
