Skip to content

Instantly share code, notes, and snippets.

@oguzhaneren
Forked from ritasker/windows-vm.json
Created August 16, 2016 16:32
Show Gist options
  • Save oguzhaneren/e8f163134d4a005fef390e5bd8cddde0 to your computer and use it in GitHub Desktop.
Save oguzhaneren/e8f163134d4a005fef390e5bd8cddde0 to your computer and use it in GitHub Desktop.
Packer script for creating Windows VMs in Azure
{
"variables": {
"client_id": "",
"client_secret": "",
"subscription_id": "",
"tenant_id": "",
"object_id": "",
"resource_group": "",
"storage_account": "",
"vm_size": "",
"location": ""
},
"builders": [{
"type": "azure-arm",
"client_id": "{{user `client_id`}}",
"client_secret": "{{user `client_secret`}}",
"subscription_id": "{{user `subscription_id`}}",
"tenant_id": "{{user `tenant_id`}}",
"resource_group_name": "{{user `resource_group`}}",
"storage_account": "{{user `storage_account`}}",
"capture_container_name": "images",
"capture_name_prefix": "packer",
"os_type": "Windows",
"image_publisher": "MicrosoftWindowsServer",
"image_offer": "WindowsServer",
"image_sku": "2012-R2-Datacenter",
"communicator": "winrm",
"winrm_use_ssl": "true",
"winrm_insecure": "true",
"winrm_timeout": "3m",
"winrm_username": "packer",
"location": "{{user `location`}}",
"vm_size": "{{user `vm_size`}}"
}],
"provisioners": [
{
"type": "powershell",
"inline": [
"Set-ExecutionPolicy -ExecutionPolicy RemoteSigned",
"iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex",
"choco install wkhtmltopdf",
"choco install octopusdeploy.tentacle"
]
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment