-
Notifications
You must be signed in to change notification settings - Fork 3
/
Vagrantfile_multibox
executable file
·233 lines (183 loc) · 9.44 KB
/
Vagrantfile_multibox
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# -*- mode: ruby -*-
# vi: set ft=ruby :
network_wifi = 'en0: Wi-Fi (AirPort)'
network_wired = 'en1: Thunderbolt Ethernet'
network = network_wifi
Vagrant.configure("2") do |config|
config.vm.define 'wsus_server', primary: true do |config|
config.berkshelf.enabled = true
config.berkshelf.berksfile_path = "cookbooks/wsus_wrapper/Berksfile"
config.vm.box = 'windows2008r2'
# config.vm.box_url = box_url
config.omnibus.chef_version = '12.0.3'
# config.omnibus.chef_version = :latest
config.omnibus.install_url = 'c:\\parent_binaries\\chef_client'
config.vm.guest = :windows #needed for vagrant omnibus to work (1.4.1 has a bug https://github.com/chef/vagrant-omnibus/issues/90)
config.vm.communicator = "winrm"
# config.winrm.port
# config.winrm.guest_port - probably useless
config.vm.guest = :windows
# config.vm.network :public_network, ip: "111.222.33.4", :bridge => $network
# config.vm.network "private_network", ip: "192.168.50.4"
# config.vm.network "forwarded_port", guest: 5985, host: 15985, auto_correct: true # winrm
# config.vm.network "forwarded_port", guest: 3389, host: 13390, auto_correct: true # remote desktop
# config.vm.network "forwarded_port", guest: 4000, host: 4000, auto_correct: true # chef-zero
# config.vm.usable_port_range -- could be useful for debugging auto_correct
config.vm.synced_folder "./cookbooks", "c:/parent_cookbooks_path"
#experiment to see if I can create share only if folder exists.
folder1 = '~/Documents/ISO_BOX_etc/binaries'
# if File.exists? File.expand_path(folder1)
# config.vm.synced_folder folder1, "c:/parent_#{File.basename(folder1)}"
# end
config.vm.synced_folder folder1, "c:/parent_#{File.basename(folder1)}" if File.exists? File.expand_path(folder1)
config.vm.provider :virtualbox do |p|
p.gui = true
p.name = "wsus_server"
# adding nat flag to make it work over VPN (may only be needed for consultants). Works in conjunction with private_network above.
p.customize ["modifyvm", :id, "--memory", "1024", "--clipboard", "bidirectional"]#, "--natdnshostresolver1", "on"]
end
config.vm.provision :chef_solo do |chef|
# chef.add_recipe "chef-dev-workstation::windows_setup"
chef.add_recipe "wsus_wrapper"
# chef.add_recipe "wsus::server"
# chef.run_list = ["recipe[...]"]
end
# Enable provisioning with chef server, specifying the chef server URL,
# config.omnibus.chef_version = :latest
# config.omnibus.chef_version = '11.8.0'
end
config.vm.define 'wsus_client' do |config|
config.berkshelf.enabled = true
config.berkshelf.berksfile_path = "cookbooks/wsus_wrapper/Berksfile"
config.vm.box = 'windows2008r2'
# config.vm.box_url = box_url
config.vm.communicator = "winrm"
# config.vm.network :public_network, ip: "111.222.33.5"#, :bridge => 'en0: Wi-Fi (AirPort)'
# config.vm.network "private_network", ip: "192.168.50.5"
# config.vm.network "forwarded_port", guest: 5985, host: 15985#, auto_correct: true # winrm
# config.vm.network "forwarded_port", guest: 3389, host: 13390#, auto_correct: true # remote desktop
# config.vm.network "forwarded_port", guest: 4000, host: 4000#, auto_correct: true # chef-zero
config.vm.synced_folder "./cookbooks", "c:/cookbooks_path"
config.vm.provider :virtualbox do |p|
p.gui = true
p.name = "wsus_client"
# adding nat flag to make it work over VPN (may only be needed for consultants). Works in conjunction with private_network above.
p.customize ["modifyvm", :id, "--memory", "1024", "--clipboard", "bidirectional"]#, "--natdnshostresolver1", "on"]
end
config.vm.provision :chef_solo do |chef|
# chef.cookbooks_path = "../"
# chef.add_recipe "chef-dev-workstation::windows_setup"
chef.add_recipe "wsus::client"
# chef.run_list = ["recipe[...]"]
end
end
config.vm.define 'wsus_ad' do |config|
config.berkshelf.enabled = true
config.berkshelf.berksfile_path = "./cookbooks/ad/Berksfile"
# config.berkshelf.berksfile_path = "./cookbooks/windows_ad/Berksfile"
config.vm.box = 'windows2008r2'
# config.vm.box_url = box_url
config.omnibus.chef_version = '12.0.3'
# config.omnibus.chef_version = :latest
config.omnibus.install_url = 'c:\\parent_binaries\\chef_client'
config.vm.guest = :windows #needed for vagrant omnibus to work (1.4.1 has a bug https://github.com/chef/vagrant-omnibus/issues/90)
config.vm.communicator = "winrm"
# config.vm.network :public_network, ip: "111.222.33.3"#, :bridge => 'en0: Wi-Fi (AirPort)'
# config.vm.network "private_network", ip: "192.168.50.3"
# config.vm.network "forwarded_port", guest: 5985, host: 15985, auto_correct: true # winrm
# config.vm.network "forwarded_port", guest: 3389, host: 13390, auto_correct: true # remote desktop
# config.vm.network "forwarded_port", guest: 4000, host: 4000, auto_correct: true # chef-zero
config.vm.synced_folder "./cookbooks", "c:/parent_cookbooks_path"
#experiment to see if I can create share only if folder exists.
folder1 = '~/Documents/ISO_BOX_etc/binaries'
if File.exists? File.expand_path(folder1)
config.vm.synced_folder folder1, "c:/parent_#{File.basename(folder1)}"
end
config.vm.provider :virtualbox do |p|
p.gui = true
p.name = "wsus_ad"
p.customize ["modifyvm", :id, "--memory", "1024", "--clipboard", "bidirectional"]#, "--natdnshostresolver1", "on"]
end
config.vm.provision :chef_solo do |chef|
# chef.cookbooks_path = "../"
# chef.add_recipe "chef-dev-workstation::windows_setup"
chef.add_recipe "ad"
# chef.run_list = ['recipe[windows_ad::default]']
# chef.node_name = "wsus_ad"
end
end
end
### Various crap for reference
# config.vm.define 'wsus_server',primary: true do |config|
# # config.berkshelf.enabled = true
# # config.berkshelf.berksfile_path = "./Berksfile"
# # Chef-Zero plugin configuration
# # config.chef_zero.enabled = true
# # Granular config
# # config.chef_zero.nodes = "../foobar/nodes"
# # config.chef_zero.environments = "../foobar/environments/baz.json"
# # config.chef_zero.data_bags = "../foobar/data_bags"
# # config.chef_zero.roles = "../foobar/roles/*.json"
# # config.chef_zero.cookbooks = "spec/fixtures/cookbooks"
# # Alternatively, you can use chef_repo_path and it will attempt to intelligently find the appropriate sub directories:
# # config.chef_zero.chef_repo_path = "../cookbooks/"
# # Every Vagrant virtual environment requires a box to build off of.
# config.vm.box = 'windows2008r2'
# # The url from where the 'config.vm.box' box will be fetched
# # config.vm.box_url = box_url
# # Create a private network, which allows host-only access to the machine
# # config.vm.network :public_network, ip: "111.222.33.4", :bridge => $network
# # config.vm.network "private_network", ip: "192.168.50.4"
# # Create a forwarded port mapping which allows access to a specific port
# # config.vm.network "forwarded_port", guest: 5985, host: 15985, auto_correct: true # winrm
# # config.vm.network "forwarded_port", guest: 3389, host: 13390, auto_correct: true # remote desktop
# # config.vm.network "forwarded_port", guest: 4000, host: 4000, auto_correct: true # chef-zero
# # Share an additional folder to the guest VM. The first argument is
# config.vm.synced_folder "./cookbooks", "c:/cookbooks_path"
# # Provider-specific configuration so you can fine-tune various
# # backing providers for Vagrant. These expose provider-specific options.
# # config.vm.guest = :windows
# # config.windows.halt_timeout = 25
# # config.winrm.username = "vagrant"
# # config.winrm.password = "vagrant"
# # config.winrm.max_tries = 10
# config.vm.communicator = "winrm"
# # Example for VirtualBox:
# config.vm.provider :virtualbox do |vb|
# # Don't boot with headless mode
# vb.gui = true
# vb.name = "wsus_server"
# # Use VBoxManage to customize the VM. For example to change memory:
# vb.customize [
# "modifyvm", :id,
# "--memory", "1024"
# ]
# end
# # Enable provisioning with chef zero
# # config.vm.provision :chef_client do |chef|
# # chef.chef_server_url = "https://api.opscode.com/organizations/alexv-ge"
# # chef.validation_key_path = "../.chef/alexv-ge-validator.pem"
# # # chef.validation_client_name = "testname001"
# # chef.node_name = "testname002"
# # chef.verbose_logging = false
# # chef.log_level = :info
# # end
# ## Enable provisioning with chef solo
# config.vm.provision :chef_solo do |chef|
# # chef.cookbooks_path = "../"
# # chef.add_recipe "chef-dev-workstation::windows_setup"
# chef.add_recipe "wsus::server"
# # chef.run_list = ["recipe[ge_splunk]"]
# end
# # Enable provisioning with chef server, specifying the chef server URL,
# # config.omnibus.chef_version = :latest
# # config.omnibus.chef_version = '11.8.0'
# # config.vm.provision :chef_client do |chef|
# # chef.chef_server_url = "https://api.opscode.com/organizations/alexv-ge"
# # chef.validation_key_path = "../.chef/alexv-ge-validator.pem"
# # # chef.validation_client_name = "testname001"
# # chef.node_name = "testname002"
# # chef.verbose_logging = false
# # chef.log_level = :info
# # end
# end