-
Notifications
You must be signed in to change notification settings - Fork 4
/
Vagrantfile
61 lines (56 loc) · 1.73 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
54
55
56
57
58
59
60
61
Vagrant::Config.run do |config|
require "settings"
# base box
config.vm.box = Vm::Basebox
config.vm.box_url = Vm::Box_url
# add a gui
if Vm::Gui == 1
config.vm.boot_mode = :gui
end
# set memory to 512MB
config.vm.customize do |vm|
vm.memory_size = Vm::Memory
end
# add a hostmaster Aegir server on a shared host-only network
config.vm.define Hm::Shortname do |hm_config|
hm_config.vm.network("192.168.#{Vm::Subnet}.10")
hm_config.vm.host_name = Hm::Hostname
hm_config.vm.customize do |vm|
vm.name = Hm::Vmname
if defined?(Hm::Memory)
vm.memory_size = Hm::Memory
end
end
if File::exists?("#{Vm::Manifests}/#{Hm::Shortname}.pp")
hm_config.vm.provision :puppet do |puppet|
puppet.manifest_file = "#{Hm::Shortname}.pp"
puppet.module_path = Vm::Modules
if defined?(Vm::Options)
puppet.options = Vm::Options
end
end
end
end
# add several hostslave Aegir servers on a shared host-only network
(1..Hs::Count).each do |index|
config.vm.define "#{Hs:Shortname}#{index}" do |hs_config|
hs_config.vm.network("192.168.#{Vm::Subnet}.1#{index}")
hs_config.vm.host_name = "#{Hs::Hostname}#{index}"
hs_config.vm.customize do |vm|
vm.name = "#{Hs::Vmname} #{index}"
if defined?(Hs::Memory)
vm.memory_size = Hs::Memory
end
end
if File::exists?("#{Vm::Manifests}/#{Hm::Shortname}.pp")
hs_config.vm.provision :puppet do |puppet|
puppet.module_path = Vm::Modules
puppet.manifest_file = "#{Hs::Shortname}.pp"
if defined?(Vm::Options)
puppet.options = Vm::Options
end
end
end
end
end
end