forked from ccollicutt/puppet-pound
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
62 lines (47 loc) · 1.95 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
62
# vi: set ft=ruby :
nodes = {
'ubuntu-pound' => [1, 20],
'centos-pound' => [1, 30]
}
Vagrant.configure("2") do |config|
nodes.each do |prefix, (count, ip_start)|
count.times do |i|
#
# Box
# - note: will not be used, but is required here
config.vm.box = "precise64"
#
# hostname
#
hostname = "%s-%02d" % [prefix, (i+1)]
config.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--memory", 1024]
end
#config.vm.provision :puppet do |puppet|
# puppet.manifests_path = "manifests"
# puppet.module_path = "modules"
# puppet.manifest_file = "site.pp"
# puppet.options = "--user vagrant"
#end
config.vm.define "#{hostname}" do |box|
puts "working on #{hostname} with ip of 192.168.20.#{ip_start+i}"
if prefix.include? 'ubuntu'
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.provision :shell, :path => 'ubuntu.sh'
elsif prefix.include? 'centos'
config.vm.box = "centos64"
config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box"
config.vm.provision :shell, :path => 'centos.sh'
end
#config.vm.provision :shell do |shell|
# shell.inline = "mkdir -p /etc/puppet/modules;
# puppet module install puppetlabs/stdlib"
#end
box.vm.hostname = "#{hostname}.example.com"
# Public
box.vm.network :private_network, :ip => "192.168.20.#{ip_start+i}", :netmask => "255.255.255.0"
end
end
end
end