-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathpacker.json
98 lines (85 loc) · 2.86 KB
/
packer.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
{
"variables": {
"ADOServicePrincipalAppId": "",
"ADOServicePrincipalSecret": "",
"TenantId": "",
"SubscriptionId": "",
"ImageDestRG": "",
"TempResourceGroup": "",
"VirtualNetwork": "",
"VirtualNetworkRG": "",
"Subnet": "",
"Location": "",
"VMSize": "",
"StorageAccountInstallersName": "",
"StorageAccountInstallersKey": "",
"StorageAccountInstallersPath": "",
"ImagePublisher":"MicrosoftWindowsDesktop",
"ImageOffer":"office-365",
"ImageSku":"19h2-evd-o365pp",
"Build_DefinitionName": "{{env `Build_DefinitionName`}}",
"Build_BuildNumber": "{{env `Build_BuildNumber`}}"
},
"builders": [
{
"type": "azure-arm",
"client_id": "{{user `ADOServicePrincipalAppId`}}",
"client_secret": "{{user `ADOServicePrincipalSecret`}}",
"tenant_id": "{{user `TenantId`}}",
"subscription_id": "{{user `SubscriptionId`}}",
"os_type": "Windows",
"managed_image_name": "{{user `Build_DefinitionName`}}-{{isotime \"2006-01-02-1504\"}}-Build{{user `Build_BuildNumber`}}",
"managed_image_resource_group_name": "{{user `ImageDestRG`}}",
"temp_resource_group_name": "{{user `TempResourceGroup`}}",
"image_publisher": "{{user `ImagePublisher`}}",
"image_offer": "{{user `ImageOffer`}}",
"image_sku": "{{user `ImageSku`}}",
"communicator": "winrm",
"winrm_use_ssl": "true",
"winrm_insecure": "true",
"winrm_timeout": "30m",
"winrm_username": "packer",
"virtual_network_name": "{{user `VirtualNetwork`}}",
"virtual_network_subnet_name": "{{user `Subnet`}}",
"virtual_network_resource_group_name": "{{user `VirtualNetworkRG`}}",
"private_virtual_network_with_public_ip": "True",
"azure_tags": {
"Image Publisher": "{{user `ImagePublisher`}}",
"Image Offer": "{{user `ImageOffer`}}",
"Image SKU": "{{user `ImageSku`}}"
},
"location": "{{user `Location`}}",
"vm_size": "{{user `VMSize`}}",
"async_resourcegroup_delete":true
}
],
"provisioners": [
{
"type": "powershell",
"inline": [
"$ErrorActionPreference='Stop'",
"Import-Module -Name Smbshare -Force -Scope Local",
"$Usr='AzureAD\\'+\"{{user `StorageAccountInstallersName`}}\"",
"New-SmbMapping -LocalPath Z: -RemotePath \"{{user `StorageAccountInstallersPath`}}\" -Username \"$Usr\" -Password \"{{user `StorageAccountInstallersKey`}}\"",
"Write-Host \"'Z:' drive mapped\""
]
},
{
"type": "WindowsUpdate",
"searchCriteria": "IsInstalled=0",
"filters": [
"exclude:$_.Title -like 'Preview'",
"include:$true"
],
"updateLimit": 20
}
{
"type": "powershell",
"script": "install_apps.ps1"
},
{
"type": "powershell",
"script": "sysprep.ps1"
}
]
}