From 8cd8c4e63a2bae231f4c542b37b80516a509eafc Mon Sep 17 00:00:00 2001 From: jayfranco999 Date: Thu, 24 Oct 2024 21:59:41 +0530 Subject: [PATCH 1/2] feat(ubuntu):Pin ubuntu 22.04 AMI ids Signed-off-by: jayfranco999 --- build-jenkins-agent-ubuntu.pkr.hcl | 1 + locals.pkr.hcl | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/build-jenkins-agent-ubuntu.pkr.hcl b/build-jenkins-agent-ubuntu.pkr.hcl index 173b8bca4..e9db59355 100644 --- a/build-jenkins-agent-ubuntu.pkr.hcl +++ b/build-jenkins-agent-ubuntu.pkr.hcl @@ -8,6 +8,7 @@ build { ssh_username = "ubuntu" # Egg-and-chicken: what is the base image to start from (eg. what is my egg)? source_ami = local.aws_ubuntu_amis[var.architecture] + source_ami = try(local.images_versions["aws"]["ubuntu"][var.agent_os_version][var.architecture], "N/A") } source "azure-arm.base" { diff --git a/locals.pkr.hcl b/locals.pkr.hcl index e0f6d1a78..9e2a8d11f 100644 --- a/locals.pkr.hcl +++ b/locals.pkr.hcl @@ -11,11 +11,6 @@ locals { "arm64" = "t4g.xlarge" } # TODO: track AMI versions with `updatecli` - # Uses aws ec2 describe-images to fetch the ami id as per the architecture - aws_ubuntu_amis = { - "amd64" = "ami-00eb69d236edcfaf8" - "arm64" = "ami-039e419d24a37cb82" - } # List available SKUs with the command `az vm image list-skus --offer 0001-com-ubuntu-server-jammy --location eastus --publisher canonical --output table` az_instance_image_sku = { "amd64" = "${local.agent_os_version_safe}-lts-gen2" From 4a2ea9eb0e922517c6db5d8056d8da7771923d91 Mon Sep 17 00:00:00 2001 From: jayfranco999 Date: Thu, 24 Oct 2024 22:04:05 +0530 Subject: [PATCH 2/2] fixup Signed-off-by: jayfranco999 --- build-jenkins-agent-ubuntu.pkr.hcl | 1 - 1 file changed, 1 deletion(-) diff --git a/build-jenkins-agent-ubuntu.pkr.hcl b/build-jenkins-agent-ubuntu.pkr.hcl index e9db59355..3ed72fde5 100644 --- a/build-jenkins-agent-ubuntu.pkr.hcl +++ b/build-jenkins-agent-ubuntu.pkr.hcl @@ -7,7 +7,6 @@ build { name = "ubuntu" ssh_username = "ubuntu" # Egg-and-chicken: what is the base image to start from (eg. what is my egg)? - source_ami = local.aws_ubuntu_amis[var.architecture] source_ami = try(local.images_versions["aws"]["ubuntu"][var.agent_os_version][var.architecture], "N/A") }