Skip to content

Instantly share code, notes, and snippets.

@tsvietOK
Created July 26, 2024 09:48
Show Gist options
  • Save tsvietOK/4f49d39fc2cfaad08bc01a0acc659189 to your computer and use it in GitHub Desktop.
Save tsvietOK/4f49d39fc2cfaad08bc01a0acc659189 to your computer and use it in GitHub Desktop.
{
"variables": {
"sub_id": null,
"client_id": null,
"client_secret": null,
"image_rg": "imagesRG",
"shared_image_gallery": "gallery",
"image_version": null,
"vnet": "0.0.0.0",
"vnet_subnet": "0.0.0.0",
"vnet_rg": "NetworkRG",
"vm_size": "Standard_D8as_v4",
"loc": "westeurope",
"build_image_update_definition_name": "image-def-update",
"exclude_from_latest": "false"
},
"builders": [
{
"name": "build image",
"type": "azure-arm",
"os_type": "Windows",
"subscription_id": "{{ user `sub_id`}}",
"client_id": "{{ user `client_id`}}",
"client_secret": "{{ user `client_secret`}}",
"virtual_network_name": "{{ user `vnet`}}",
"virtual_network_subnet_name": "{{ user `vnet_subnet`}}",
"virtual_network_resource_group_name": "{{ user `vnet_rg`}}",
"vm_size": "{{ user `vm_size`}}",
"shared_image_gallery": {
"subscription": "{{user `sub_id`}}",
"resource_group": "{{ user `image_rg`}}",
"gallery_name": "{{ user `shared_image_gallery`}}",
"image_name": "{{ user `build_image_definition_name`}}",
"image_version": "latest"
},
"managed_image_name": "{{ user `build_image_definition_name`}}",
"managed_image_resource_group_name": "{{ user `image_rg`}}",
"managed_image_storage_account_type": "Premium_LRS",
"shared_image_gallery_destination": {
"resource_group": "{{ user `image_rg`}}",
"gallery_name": "{{ user `shared_image_gallery`}}",
"image_name": "{{ user `build_image_update_definition_name`}}",
"image_version": "{{ user `image_version`}}",
"replication_regions": ["{{ user `loc`}}"],
"exclude_from_latest": true
},
"shared_image_gallery_timeout": "2h",
"location": "{{ user `loc`}}",
"communicator": "winrm",
"winrm_use_ssl": "true",
"winrm_insecure": "true",
"winrm_timeout": "3m",
"winrm_username": "packer",
"shared_gallery_image_version_exclude_from_latest": "{{ user `exclude_from_latest`}}"
}
],
"provisioners": [
{
"type": "powershell",
"scripts": "{{ template_dir }}\\scripts\\Finalize-VM.ps1",
"timeout": "60m"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment