-
Notifications
You must be signed in to change notification settings - Fork 23
/
Vagrantfile
40 lines (31 loc) · 1.51 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
hosts = [ { name: 'ansible-softwareraid', cpu_cap: "50", cpus: "1", ram: "512", disk1: './test_disk1.vdi', disk2: 'test_disk2.vdi' }]
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider :virtualbox do |vb|
vb.customize ["storagectl", :id, "--add", "sata", "--name", "SATAController" , "--portcount", 2, "--hostiocache", "on"]
end
hosts.each do |host|
config.vm.define host[:name] do |node|
node.vm.hostname = host[:name]
node.vm.box = "boxcutter/ubuntu1404"
node.vm.provider :virtualbox do |vb|
vb.name = host[:name]
vb.customize ["modifyvm", :id, "--cpuexecutioncap", host[:cpu_cap]]
vb.customize ["modifyvm", :id, "--memory", host[:ram]]
vb.customize ["modifyvm", :id, "--cpus", host[:cpus]]
vb.customize ['createhd', '--filename', host[:disk1], '--size', 2 * 1024]
vb.customize ['createhd', '--filename', host[:disk2], '--size', 2 * 1024]
vb.customize ['storageattach', :id, '--storagectl', "SATAController", '--port', 1, '--device', 0, '--type', 'hdd', '--medium', host[:disk1] ]
vb.customize ['storageattach', :id, '--storagectl', "SATAController", '--port', 2, '--device', 0, '--type', 'hdd', '--medium', host[:disk2] ]
end
end
# information on available options.
config.vm.provision "ansible" do |ansible|
ansible.playbook = ENV['PLAYBOOK_FILE']
ansible.verbose = 'vv'
ansible.sudo = true
end
end
end