forked from rgl/windows-vagrant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
windows-10-vsphere.json
109 lines (109 loc) · 3.5 KB
/
windows-10-vsphere.json
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
{
"variables": {
"vsphere_disk_size": "61440",
"vsphere_iso_url": "[{{env `GOVC_DATASTORE`}}] iso/windows-10-1607-17763.107.101029-1455.rs5_release_svc_refresh_CLIENT_LTSC_EVAL_x64FRE_en-us.iso",
"vsphere_tools_iso_url": "[{{env `GOVC_DATASTORE`}}] iso/VMware-tools-windows-11.0.1-14773994.iso",
"vsphere_host": "{{env `GOVC_HOST`}}",
"vsphere_username": "{{env `GOVC_USERNAME`}}",
"vsphere_password": "{{env `GOVC_PASSWORD`}}",
"vsphere_esxi_host": "{{env `VSPHERE_ESXI_HOST`}}",
"vsphere_datacenter": "{{env `GOVC_DATACENTER`}}",
"vsphere_cluster": "{{env `GOVC_CLUSTER`}}",
"vsphere_datastore": "{{env `GOVC_DATASTORE`}}",
"vsphere_folder": "{{env `VSPHERE_TEMPLATE_FOLDER`}}",
"vsphere_network": "{{env `VSPHERE_VLAN`}}"
},
"sensitive-variables": [
"vsphere_password"
],
"builders": [
{
"name": "windows-10-amd64-vsphere",
"vm_name": "windows-10-amd64-vsphere",
"type": "vsphere-iso",
"guest_os_type": "windows9_64Guest",
"disk_size": "{{user `vsphere_disk_size`}}",
"disk_thin_provisioned": true,
"disk_controller_type": "pvscsi",
"vcenter_server": "{{user `vsphere_host`}}",
"username": "{{user `vsphere_username`}}",
"password": "{{user `vsphere_password`}}",
"insecure_connection": "true",
"datacenter": "{{user `vsphere_datacenter`}}",
"cluster": "{{user `vsphere_cluster`}}",
"host": "{{user `vsphere_esxi_host`}}",
"folder": "{{user `vsphere_folder`}}",
"datastore": "{{user `vsphere_datastore`}}",
"network_card": "vmxnet3",
"network": "{{user `vsphere_network`}}",
"convert_to_template": false,
"RAM": 4096,
"CPUs": 4,
"iso_paths": [
"{{user `vsphere_iso_url`}}",
"{{user `vsphere_tools_iso_url`}}"
],
"floppy_files": [
"windows-10/autounattend.xml",
"vmtools.ps1",
"winrm.ps1"
],
"communicator": "winrm",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout": "4h",
"shutdown_command": "shutdown /s /t 0 /f /d p:4:1 /c \"Packer Shutdown\""
}
],
"provisioners": [
{
"type": "powershell",
"script": "disable-windows-updates.ps1"
},
{
"type": "powershell",
"inline": "<# disable Windows Defender #> Set-MpPreference -DisableRealtimeMonitoring $true; Set-ItemProperty -Path 'HKLM:/SOFTWARE/Policies/Microsoft/Windows Defender' -Name DisableAntiSpyware -Value 1"
},
{
"type": "powershell",
"inline": "<# disable OneDrive #> $k = 'HKLM:/SOFTWARE/Policies/Microsoft/Windows/OneDrive'; mkdir $k | Out-Null; Set-ItemProperty -Path $k -Name DisableFileSyncNGSC -Value 1"
},
{
"type": "powershell",
"script": "virtualbox-prevent-vboxsrv-resolution-delay.ps1"
},
{
"type": "windows-restart"
},
{
"type": "powershell",
"script": "provision.ps1"
},
{
"type": "windows-update"
},
{
"type": "powershell",
"script": "enable-remote-desktop.ps1"
},
{
"type": "powershell",
"script": "provision-openssh.ps1"
},
{
"type": "windows-restart"
},
{
"type": "powershell",
"script": "provision-cloudbase-init.ps1"
},
{
"type": "powershell",
"script": "eject-media.ps1"
},
{
"type": "powershell",
"script": "optimize.ps1"
}
]
}