forked from sous-chefs/windows_ad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
131 lines (117 loc) · 4.94 KB
/
Vagrantfile
File metadata and controls
131 lines (117 loc) · 4.94 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
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
win_2008_r2_box = 'windows-2008r2'
#win_20008_r2_box_url = 'https://atlas.hashicorp.com/opentable/boxes/win-2008r2-standard-amd64-nocm'
# win_2008_r2_box = 'opentable/win-2008r2-enterprise-amd64-nocm'
# win_20008_r2_box_url = 'https://atlas.hashicorp.com/opentable/boxes/win-2008r2-enterprise-amd64-nocm'
win_2012_box = 'windows-2012'
#win_2012_box_url = 'https://atlas.hashicorp.com/kensykora/boxes/windows_2012_standard'
win_2012_r2_box = 'windows-2012r2'
#win_2012_r2_box_url = 'https://atlas.hashicorp.com/opentable/boxes/win-2012r2-standard-amd64-nocm'
win_2012_r2_core_box = 'windows-2012r2-core'
#win_2012_r2_core_box_url = 'https://atlas.hashicorp.com/kensykora/boxes/windows_2012_r2_standard_core'
win_7_box = 'opentable/win-7-enterprise-amd64-nocm'
#win_7_box_url = 'https://atlas.hashicorp.com/opentable/boxes/win-7-enterprise-amd64-nocm'
# win_7_box = 'windows-7'
# win_7_box_url = 'https://atlas.hashicorp.com/opentable/boxes/win-7-professional-amd64-nocm'
win_8_box = 'windows-81'
#win_8_box_url = 'https://atlas.hashicorp.com/opentable/boxes/win-8.1-enterprise-amd64-nocm'
machines = {
'win2012r2core' => {
'hostname' => 'win2012r2core',
'box' => win_2012_r2_core_box,
'ip' => '192.168.1.13',
'http_port' => '8095',
'rdp_port' => '8096',
'winrm_port' => '8097',
'run_list' => [
'recipe[test_windows_ad::setup_dc]'
]
},
'win2008r2' => {
'hostname' => 'win2008r2',
'box' => win_2008_r2_box,
'ip' => '192.168.1.10',
'http_port' => '8080',
'rdp_port' => '8081',
'winrm_port' => '8082',
'run_list' => [
'recipe[test_windows_ad::setup_forest]',
'recipe[test_windows_ad::ou]',
'recipe[test_windows_ad::group]'
]
},
'win2012' => {
'hostname' => 'win2012',
'box' => win_2012_box,
'ip' => '192.168.1.11',
'http_port' => '8085',
'rdp_port' => '8086',
'winrm_port' => '8087',
'run_list' => [
'recipe[test_windows_ad::setup_forest]'
# 'recipe[test_windows_ad::join_domain]',
# 'recipe[test_windows_ad::unjoin_domain]'
]
},
'win2012r2' => {
'hostname' => 'win2012r2',
'box' => win_2012_r2_box,
'ip' => '192.168.1.12',
'http_port' => '8090',
'rdp_port' => '8091',
'winrm_port' => '8092',
'run_list' => [
'recipe[test_windows_ad::setup_forest]',
# 'recipe[test_windows_ad::join_domain]',
# 'recipe[test_windows_ad::unjoin_domain]'
'recipe[test_windows_ad::ou]',
'recipe[test_windows_ad::user]',
'recipe[test_windows_ad::group]'
]
}
}
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |global_config|
machines.each_pair do |name, options|
global_config.vm.define name do |config|
config.vm.box = name
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = options['box']
config.vm.box_url = options['box_url']
config.vm.hostname = options['hostname']
config.vm.communicator = 'winrm'
config.vm.guest = :windows
port_80 = 1024 + rand(1024)
# port_5985 = 1024 + rand(1024)
# while port_5985 == port_80 do
# port_5985 = 1024 + rand(1024)
# end
config.vm.network :forwarded_port, guest: 80, host: options['http_port'], id: 'http', auto_correct: true
config.vm.network :forwarded_port, guest: 3389, host: options['rdp_port'], id: 'rdp', auto_correct: true
config.vm.network :forwarded_port, guest: 5985, host: options['winrm_port'], id: 'winrm', auto_correct: true
config.vm.network 'private_network', ip: options['ip'], virtualbox__intnet: 'windows_ad'
config.vm.provider 'virtualbox' do |vb|
# vb.gui = true
vb.customize ['modifyvm', :id, "--nicpromisc1", "allow-all"]
vb.customize ['modifyvm', :id, "--nicpromisc2", "allow-all"]
# vb.customize ['modifyvm', :id, "--natdnshostresolver1", "on"]
# vb.customize ['modifyvm', :id, "--natdnsproxy1", "on"]
end
config.omnibus.chef_version = :latest
# config.omnibus.chef_version = '11.18.12'
# config.chef_zero.cookbooks = [ 'test/fixtures/cookbooks', 'test/fixtures/test_cookbooks' ]
# config.vm.provision 'chef_client', run: 'always' do |chef|
config.vm.provision 'chef_solo', run: 'always' do |chef|
chef.log_level = 'info'
chef.cookbooks_path = "../../cookbooks"
# chef.custom_config_path = 'Vagrantfile.chef'
chef.file_cache_path = 'c:/var/chef/cache'
chef.run_list = options['run_list']
# You may also specify custom JSON attributes:
chef.json = {}
end
end
end
end