blob: bd98bfa63232b477fd323db0ae929d54c64b1dcc [file] [log] [blame]
Sergio Slobodrianee4b2bc2017-06-05 10:08:59 -04001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
4# This Vagrantfile is used for testing the installer. It creates 3 servers
5# with a vanilla ubutu server image on it.
Sergio Slobodriand24189e2017-06-10 23:27:15 -04006require 'yaml'
7
8# Load the settings which are tweaked by the installer to avoid naming conflicts
9settings = YAML.load_file 'settings.vagrant.yaml'
10
Sergio Slobodrianee4b2bc2017-06-05 10:08:59 -040011Vagrant.configure(2) do |config|
12 config.vm.synced_folder ".", "/vagrant", disabled: true
13 (1..3).each do |i|
Sergio Slobodriand24189e2017-06-10 23:27:15 -040014 config.vm.define "#{settings['server_name']}#{i}" do |d|
Sergio Slobodrianee4b2bc2017-06-05 10:08:59 -040015 d.ssh.forward_agent = true
Sergio Slobodriand24189e2017-06-10 23:27:15 -040016 d.vm.box = settings["box_source"]
17 d.vm.hostname = "#{settings['server_name']}#{i}"
Sergio Slobodrianee4b2bc2017-06-05 10:08:59 -040018 d.vm.provider "libvirt" do |v|
19 v.memory = 6144
Sergio Slobodriancab0a392017-07-13 08:42:10 -040020 v.cpus = 2
Sergio Slobodrianfb89efa2017-08-02 14:16:14 -040021 if settings['vProvider'] == "KVM"
22 v.cpu_mode = 'host-passthrough'
23 v.cpu_fallback = 'allow'
24 end
Sergio Slobodrianee4b2bc2017-06-05 10:08:59 -040025 end
26 end
27 end
28
29 if Vagrant.has_plugin?("vagrant-cachier")
30 config.cache.scope = :box
31 end
32
33end