forked from automatesql/Automated-Sandbox-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvagrantfile
More file actions
78 lines (63 loc) · 3.6 KB
/
Copy pathvagrantfile
File metadata and controls
78 lines (63 loc) · 3.6 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
=begin
Copyright © 2024 AutomateSQL, LLC - https://www.automatesql.com
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit persons to
whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=end
=begin
This example vagrantfile will create 5 virtual machines by default. Modify the name, memory, cpus, vnet, and nat_device parameters for your environment.
If you don't require this many machines simply comment out the lines and the comma preciding it. Need more?
Add a line and modify the parameters.
The config.ssh.password will need to match the password you provided when creating the image.
=end
Vagrant.configure("2") do |config|
machines = [
{ name: "DC1", memory: 2048, cpus: 4, vnet: "VMnet8", nat_device: "vmnet8" } ,
{ name: "SRV1", memory: 2048, cpus: 4, vnet: "VMnet8", nat_device: "vmnet8" } ,
{ name: "SQL1", memory: 2048, cpus: 4, vnet: "VMnet8", nat_device: "vmnet8" } ,
{ name: "SQL2", memory: 2048, cpus: 4, vnet: "VMnet8", nat_device: "vmnet8" },
{ name: "SQL3", memory: 2048, cpus: 4, vnet: "VMnet8", nat_device: "vmnet8" }
]
#config.vm.usable_port_range = 8500..8999
config.vm.communicator = "winssh"
config.vm.guest = :windows
config.vm.box = "C:/Automated-Sandbox-Framework/Win2025/output/win2025_gui.box" #"automatesql/win2025"
config.ssh.username = "Administrator"
config.ssh.password = "packer"
config.winssh.connect_timeout = 30
#Loop through the machines and configure each one
machines.each do |machine|
config.vm.define machine[:name] do |node|
node.vm.provision "shell",
run: "once",
name: "Set hostname",
inline: "powershell rename-computer -NewName '#{machine[:name]}' -Restart",
privileged: true
node.vm.provider "vmware_desktop" do |mybasebox|
mybasebox.gui = true
mybasebox.allowlist_verified = :disable_warning
mybasebox.nat_device = machine[:nat_device]
mybasebox.vmx["displayname"] = machine[:name]
mybasebox.vmx["memsize"] = machine[:memory]
mybasebox.vmx["numvcpus"] = machine[:cpus]
mybasebox.vmx["cpuid.coresPerSocket"] = machine[:cpus]
mybasebox.vmx["vvtd.enable"] = "TRUE" #If you require nested virtualization, leave this set to TRUE.
mybasebox.vmx["vhv.enable"] = "TRUE" #If you require nested virtualization, leave this set to TRUE.
mybasebox.vmx["vpmc.enable"] = "FALSE"
mybasebox.vmx["ethernet0.connectiontype"] = "custom"
mybasebox.vmx["ethernet0.vnet"] = machine[:vnet]
end
end
end
end