-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathPacker-VMWin2016-IIS-Azure-squasta.json
54 lines (47 loc) · 1.79 KB
/
Packer-VMWin2016-IIS-Azure-squasta.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
{
"_comment": "This Packer File generated a Windows Server 2016 image with IIS 8.5 on Azure",
"variables": {
"client_id": "put here your client id",
"client_secret": "put here your client secret",
"resource_group_name": "RG-Packer1-Stan",
"storage_account": "storageaccountpackerstan",
"subscription_id": "put here your Azure Subscription ID",
"object_id": "put here your Service Principal Name (SPN) id",
"tenant_id": "put here your tenant = Azure AD ID",
},
"builders": [{
"type": "azure-arm",
"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",
"resource_group_name": "{{user `resource_group`}}",
"storage_account": "{{user `storage_account`}}",
"subscription_id": "{{user `subscription_id`}}",
"object_id": "{{user `object_id`}}",
"tenant_id": "{{user `tenant_id`}}",
"capture_container_name": "imagesstan",
"capture_name_prefix": "packerstan",
"os_type": "Windows",
"image_publisher": "MicrosoftWindowsServer",
"image_offer": "WindowsServer",
"image_sku": "2016-Datacenter",
"communicator": "winrm",
"winrm_use_ssl": "true",
"winrm_insecure": "true",
"winrm_timeout": "3m",
"winrm_username": "packer",
"azure_tags": {
"madewith": "HashiCorp Packer",
"Creator" : "Stan"
},
"location": "West Europe",
"vm_size": "Standard_D2_v2"
}],
"provisioners": [{
"type": "powershell",
"inline": [
"Add-WindowsFeature Web-Server",
"if( Test-Path $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml ){ rm $Env:SystemRoot\\windows\\system32\\Sysprep\\unattend.xml -Force}",
"& $Env:SystemRoot\\System32\\Sysprep\\Sysprep.exe /oobe /generalize /shutdown /quiet"
]
}]
}