-
Notifications
You must be signed in to change notification settings - Fork 5
/
Vagrantfile
76 lines (66 loc) · 2.68 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
# vagrant-proxyconf: https://tmatilai.github.io/vagrant-proxyconf
HTTP_PROXY="http://proxy:3128"
HTTPS_PROXY=HTTP_PROXY
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = HTTP_PROXY
config.proxy.https = HTTPS_PROXY
config.proxy.no_proxy = "localhost, 127.0.0.1, .hacklab"
end
if Vagrant.has_plugin?("vagrant-hosts")
config.vm.provision :hosts do |provisioner|
provisioner.add_localhost_hostnames = false
provisioner.autoconfigure = true
provisioner.sync_hosts = true
provisioner.add_host '192.168.250.20', ['puppet']
end
end
config.vm.box = "puppetlabs/centos-7.2-64-puppet"
# puppet server + puppet agent
config.vm.define "puppetserver" do |puppetserver|
puppetserver.vm.hostname = "puppetserver.hacklab"
puppetserver.vm.network :private_network, ip: "192.168.250.20"
puppetserver.vm.provision "shell", path: "installer.sh"
puppetserver.vm.provider "virtualbox" do |v|
v.customize [ "modifyvm", :id, "--cpus", "2" ]
v.customize [ "modifyvm", :id, "--memory", "1024" ]
v.customize [ "modifyvm", :id, "--name", "puppetserver.hacklab" ]
v.customize [ "modifyvm", :id, "--groups", "/pcp" ]
end
end
# puppet agent + puppetdb + puppet explorer
config.vm.define "puppetdb" do |puppetdb|
puppetdb.vm.hostname = "puppetdb.hacklab"
puppetdb.vm.network :private_network, ip: "192.168.250.25"
puppetdb.vm.provider "virtualbox" do |v|
v.customize [ "modifyvm", :id, "--cpus", "2" ]
v.customize [ "modifyvm", :id, "--memory", "1024" ]
v.customize [ "modifyvm", :id, "--name", "puppetdb.hacklab" ]
v.customize [ "modifyvm", :id, "--groups", "/pcp" ]
end
puppetdb.vm.provision "puppet_server" do |puppet|
puppet.puppet_server = "puppetserver.hacklab"
puppet.puppet_node = "puppetdb.hacklab"
puppet.options = "--verbose"
end
end
# puppet agent + mcollective client + activemq
config.vm.define "puppetmq" do |puppetmq|
puppetmq.vm.hostname = "puppetmq.hacklab"
puppetmq.vm.network :private_network, ip: "192.168.250.30"
puppetmq.vm.provider "virtualbox" do |v|
v.customize [ "modifyvm", :id, "--cpus", "2" ]
v.customize [ "modifyvm", :id, "--memory", "1024" ]
v.customize [ "modifyvm", :id, "--name", "puppetmq.hacklab"]
v.customize [ "modifyvm", :id, "--groups", "/pcp" ]
end
puppetmq.vm.provision "puppet_server" do |puppet|
puppet.puppet_server = "puppetserver.hacklab"
puppet.puppet_node = "puppetmq.hacklab"
puppet.options = "--verbose"
end
end
end