-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPacker_Build_Win10.json
52 lines (44 loc) · 1.91 KB
/
Packer_Build_Win10.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
{
"variables": {
"client_id": "6ce7fed6-e39e-4339-a28f-64a0c21c0108",
"client_secret": "fQEL4sLj-S4bp~2O2_fMG3On.~bjL89SXc",
"az_tenant_id": "{{env `az_tenant_id`}}",
"subscription_id": "{{env `ARM_SUBSCRIPTION_ID`}}",
"packaged_app_installs_path": "{{env `packaged_app_installs_path`}}",
"Build_DefinitionName": "{{env `Build_DefinitionName`}}",
"Build_BuildNumber": "{{env `Build_BuildNumber`}}"
},
"builders": [{
"type": "azure-arm",
"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",
"tenant_id": "{{user `az_tenant_id`}}",
"subscription_id": "{{user `subscription_id`}}",
"managed_image_resource_group_name": "myPackerGroup",
"managed_image_name": "{{user `Build_DefinitionName` | clean_image_name}}-{{isotime \"2006-01-02-1504\"}}-Build{{user `Build_BuildNumber`}}",
"os_type": "Windows",
"image_publisher": "MicrosoftWindowsDesktop",
"image_offer": "windows-10",
"image_sku": "19h2-evd",
"communicator": "winrm",
"winrm_use_ssl": true,
"winrm_insecure": true,
"winrm_timeout": "5m",
"winrm_username": "packer",
"azure_tags": {
"dept": "EEC Consulting",
"task": "Image deployment"
},
"location": "eastus2",
"vm_size": "Standard_D2_v2"
}],
"provisioners": [{
"type": "powershell",
"inline": [
"while ((Get-Service RdAgent).Status -ne 'Running') { Start-Sleep -s 60 }",
"while ((Get-Service WindowsAzureGuestAgent).Status -ne 'Running') { Start-Sleep -s 60 }",
"& $env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /quiet /quit",
"while($true) { $imageState = Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\State | Select ImageState; if($imageState.ImageState -ne 'IMAGE_STATE_GENERALIZE_RESEAL_TO_OOBE') { Write-Output $imageState.ImageState; Start-Sleep -s 60 } else { break } }"
]
}]
}