-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
48 lines (35 loc) · 1.74 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_version ">= 1.6.2"
# Relative path where 'shared-content' can be found
# IMPORTANT: Custom scenarios are deployed in folder '~/QlikMachineImages/personal'
sharedContentRelativePath = '../../shared-content'
require 'json'
# Module dependency for custom VM values setup
require File.dirname(__FILE__) + '/' +sharedContentRelativePath + '/scripts/custom-setup.rb'
# Load scenario data configuration file
scenario = JSON.parse(File.read(File.join(File.dirname(__FILE__), 'scenario.json')))
# Overwrite of VM values (cpus, memory) from custom values setup in QMI client
vals = CustomSetup.getValues( scenario )["servers"][0]
# Vagrant intialization
Vagrant.configure("2") do |config|
config.vm.define vals["name"]
config.vm.box = vals["box"]
config.vm.network "private_network", ip: vals["ip"]
config.vm.hostname = vals["name"]
config.vm.provider :virtualbox do |v, override|
v.name = vals["name"]
v.linked_clone = true
# v.customize ['setextradata', :id, 'GUI/ScaleFactor', '1.25']
v.customize ["modifyvm", :id, "--memory", vals["memory"]]
v.customize ["modifyvm", :id, "--cpus", vals["cpus"]]
v.customize ["modifyvm", :id, "--vram", 64]
v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
end
# Shared synced folders setup (Host <-> Guest)
config.vm.synced_folder "./files", "c:/installation/"
config.vm.synced_folder sharedContentRelativePath, "c:/shared-content/"
# Provision scripts execution
config.vm.provision :shell, path: sharedContentRelativePath + "/scripts/modules/q-background.ps1", :powershell_elevated_interactive => true
config.vm.provision :shell, path: "./scripts/provisioner.ps1"
end