forked from elasticdog/puppet-sandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile.precise64
40 lines (34 loc) · 1.31 KB
/
Vagrantfile.precise64
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 :
domain = 'example.com'
puppet_nodes = [
{:hostname => 'fpm', :ip => '172.16.32.9', :box => 'precise64'},
{:hostname => 'puppet', :ip => '172.16.32.10', :box => 'precise64', :fwdhost => 8140, :fwdguest => 8140, :ram => 512},
{:hostname => 'client1', :ip => '172.16.32.11', :box => 'precise64'},
{:hostname => 'client2', :ip => '172.16.32.12', :box => 'precise64'},
]
Vagrant.configure("2") do |config|
puppet_nodes.each do |node|
config.vm.define node[:hostname] do |node_config|
node_config.vm.box = node[:box]
node_config.vm.box_url = 'http://files.vagrantup.com/' + node_config.vm.box + '.box'
node_config.vm.hostname = node[:hostname] + '.' + domain
node_config.vm.network :private_network, ip: node[:ip]
if node[:fwdhost]
node_config.vm.network :forwarded_port, guest: node[:fwdguest], host: node[:fwdhost]
end
memory = node[:ram] ? node[:ram] : 256;
node_config.vm.provider :virtualbox do |vb|
vb.customize [
'modifyvm', :id,
'--name', node[:hostname],
'--memory', memory.to_s
]
end
node_config.vm.provision :puppet do |puppet|
puppet.manifests_path = 'provision/manifests'
puppet.module_path = 'provision/modules'
end
end
end
end