forked from elasticdog/puppet-sandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
56 lines (47 loc) · 1.86 KB
/
Vagrantfile
File metadata and controls
56 lines (47 loc) · 1.86 KB
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
domain = 'example.com'
puppet_nodes = [
{:hostname => 'puppet', :ip => '172.16.32.10', :box => 'ubuntu/wily64', :fwdhost => 8140, :fwdguest => 8140, :ram => 1028},
{:hostname => 'client1', :ip => '172.16.32.11', :box => 'ubuntu/wily64'},
{:hostname => 'client2', :ip => '172.16.32.12', :box => 'ubuntu/wily64'},
]
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]
node_config.vm.synced_folder "storage/", "/storage",
owner: 'puppet',
group: 'puppet'
node_config.vm.synced_folder ".", "/vagrant",
owner: 'puppet',
group: 'puppet'
if node[:fwdhost]
node_config.vm.network :forwarded_port, guest: node[:fwdguest], host: node[:fwdhost]
end
#if Vagrant.has_plugin?("vagrant-proxyconf")
# config.proxy.http = "http://193.120.90.48:8080/"
# config.proxy.https = "http://193.120.90.48:8080/"
# config.proxy.no_proxy = "localhost,127.0.0.1,.example.com"
#end
config.vm.provision "fix-no-tty", type: "shell" do |s|
s.privileged = false
s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile"
end
memory = node[:ram] ? node[:ram] : 384;
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.module_path = 'environments/provision/modules'
end
end
end
end