-
Notifications
You must be signed in to change notification settings - Fork 11
/
Vagrantfile
53 lines (49 loc) · 1.37 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
48
49
50
51
52
53
require 'json'
require 'fileutils'
# read service definitions
service = File.read('./tiger-local-vm.json')
svc = JSON.parse(service)
Vagrant.configure("2") do |config|
config.vm.box = "trusty64"
config.vm.box_url = "https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/14.04/providers/virtualbox.box"
config.vm.define "tiger" do |machine|
machine.vm.provider :virtualbox do |v|
if svc["ram"]
v.memory = svc["ram"]
else
v.memory = 8096
end
if svc["cpu"]
v.cpus = svc["cpu"]
else
v.cpus = 4
end
# include a mounted drive
if svc["tiger_vb_mount"]
d = svc["tiger_vb_mount"]
v.customize [
"createhd",
"--filename", d["path"],
"--size", d["size"]
]
v.customize [
"storageattach", :id,
"--storagectl", d["storagectl"],
"--port", d["port"],
"--device", d["device"],
"--type", d["type"],
"--medium", d["path"]
]
end
end
machine.vm.provision "ansible" do |ansible|
ansible.extra_vars = { ansible_ssh_user: "vagrant", hostname: "tiger"}
ansible.playbook = "./provisioning/tigergeocoder.yml"
ansible.verbose = "vvvv"
ansible.extra_vars = {
tiger_local_vm: true,
tiger_mounted_drive_path: "/dev/sdb"
}
end
end
end