mirror of
https://github.com/actions/runner-images.git
synced 2025-12-11 03:27:05 +00:00
Add the ability to specify Packer Azure plugin version (#11587)
This commit is contained in:
@@ -119,6 +119,8 @@ Function GenerateResourcesAndImage {
|
||||
The default is 'ask'.
|
||||
.PARAMETER Tags
|
||||
Tags to be applied to the Azure resources created.
|
||||
.PARAMETER PluginVersion
|
||||
Specify the version of the packer Azure plugin to use. The default is "2.2.1".
|
||||
.EXAMPLE
|
||||
GenerateResourcesAndImage -SubscriptionId {YourSubscriptionId} -ResourceGroupName "shsamytest1" -ImageGenerationRepositoryRoot "C:\runner-images" -ImageType Ubuntu2004 -AzureLocation "East US"
|
||||
#>
|
||||
@@ -144,6 +146,8 @@ Function GenerateResourcesAndImage {
|
||||
[Parameter(Mandatory = $False)]
|
||||
[string] $AzureTenantId,
|
||||
[Parameter(Mandatory = $False)]
|
||||
[string] $PluginVersion = "2.2.1",
|
||||
[Parameter(Mandatory = $False)]
|
||||
[switch] $RestrictToAgentIpAddress,
|
||||
[Parameter(Mandatory = $False)]
|
||||
[switch] $Force,
|
||||
@@ -218,7 +222,7 @@ Function GenerateResourcesAndImage {
|
||||
$InstallPassword = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper()
|
||||
|
||||
Write-Host "Downloading packer plugins..."
|
||||
& $PackerBinary init $TemplatePath
|
||||
& $PackerBinary plugins install github.com/hashicorp/azure $PluginVersion
|
||||
|
||||
if ($LastExitCode -ne 0) {
|
||||
throw "Packer plugins download failed."
|
||||
|
||||
@@ -8,6 +8,7 @@ param(
|
||||
[String] [Parameter (Mandatory=$true)] $TempResourceGroupName,
|
||||
[String] [Parameter (Mandatory=$true)] $SubscriptionId,
|
||||
[String] [Parameter (Mandatory=$true)] $TenantId,
|
||||
[String] [Parameter (Mandatory=$false)] $pluginVersion = "2.2.1",
|
||||
[String] [Parameter (Mandatory=$false)] $VirtualNetworkName,
|
||||
[String] [Parameter (Mandatory=$false)] $VirtualNetworkRG,
|
||||
[String] [Parameter (Mandatory=$false)] $VirtualNetworkSubnet,
|
||||
@@ -40,7 +41,7 @@ Write-Host "Show Packer Version"
|
||||
packer --version
|
||||
|
||||
Write-Host "Download packer plugins"
|
||||
packer init $TemplatePath
|
||||
packer plugins install github.com/hashicorp/azure $pluginVersion
|
||||
|
||||
Write-Host "Validate packer template"
|
||||
packer validate -syntax-only $TemplatePath
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
azure = {
|
||||
source = "github.com/hashicorp/azure"
|
||||
version = "1.4.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
managed_image_name = var.managed_image_name != "" ? var.managed_image_name : "packer-${var.image_os}-${var.image_version}"
|
||||
}
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
azure = {
|
||||
source = "github.com/hashicorp/azure"
|
||||
version = "1.4.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
managed_image_name = var.managed_image_name != "" ? var.managed_image_name : "packer-${var.image_os}-${var.image_version}"
|
||||
}
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
azure = {
|
||||
source = "github.com/hashicorp/azure"
|
||||
version = "1.4.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
managed_image_name = var.managed_image_name != "" ? var.managed_image_name : "packer-${var.image_os}-${var.image_version}"
|
||||
}
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
azure = {
|
||||
source = "github.com/hashicorp/azure"
|
||||
version = "1.4.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
image_os = "ubuntu22"
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
azure = {
|
||||
source = "github.com/hashicorp/azure"
|
||||
version = "1.4.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
managed_image_name = var.managed_image_name != "" ? var.managed_image_name : "packer-${var.image_os}-${var.image_version}"
|
||||
}
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
azure = {
|
||||
source = "github.com/hashicorp/azure"
|
||||
version = "1.4.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
managed_image_name = var.managed_image_name != "" ? var.managed_image_name : "packer-${var.image_os}-${var.image_version}"
|
||||
}
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
azure = {
|
||||
source = "github.com/hashicorp/azure"
|
||||
version = "1.4.5"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
managed_image_name = var.managed_image_name != "" ? var.managed_image_name : "packer-${var.image_os}-${var.image_version}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user