-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
35 lines (31 loc) · 1.3 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
def provisioner(vm_name)
vm_name.to_s.split("_").first
end
Vagrant.configure("2") do |config|
config.vm.box = "centos64-64"
vms = {:puppet_master => {:hostname => "puppet-master.local",
:ip => "192.168.100.10",
:bootstrap => "puppet_master.sh"},
:puppet_agent1 => {:hostname => "puppet-agent1.local",
:ip => "192.168.100.20",
:bootstrap => "puppet_agent.sh"},
:puppet_agent2 => {:hostname => "puppet-agent2.local",
:ip => "192.168.100.21",
:bootstrap => "puppet_agent.sh"},
:babushka_test => {:hostname => "babushka-test.local",
:ip => "192.168.100.30",
:bootstrap => "bootstrap.sh"}}
vms.each_pair do |name, options|
config.vm.define name do |vm|
vm.vm.hostname=options[:hostname]
vm.vm.network :private_network, ip: options[:ip]
vm.vm.synced_folder "#{provisioner name}", "/provision_scripts"
vm.vm.provision :shell, :inline => "/provision_scripts/bootstrap/#{options[:bootstrap]}"
vm.vm.provider :virtualbox do |vb|
vb.name = name.to_s
end
end
end
end