From e98dceec930e284d0c9aa223d550005ef042fb71 Mon Sep 17 00:00:00 2001 From: "elston.lewis" Date: Mon, 16 Sep 2024 15:24:14 +0200 Subject: [PATCH] Added Windows 2022 variables --- Jenkinsfile | 7 +++++++ windows.pkr.hcl | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index cc6e30e..04a7deb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -80,6 +80,7 @@ switch(OS) { case "Windows Server 2019": base_name = "WindowsServer-2019" packer_script = "windows.pkr.hcl" + product_codes = "0002" break case "Windows Server 2019 SQL Server Web 2019": @@ -107,6 +108,12 @@ switch(OS) { base_name = "Windows-10" packer_script = "windows.pkr.hcl" break + + case "Windows Server 2022": + base_name = "WindowsServer-2022" + packer_script = "windows.pkr.hcl" + product_codes = "0002" + break } def source_omi = [ diff --git a/windows.pkr.hcl b/windows.pkr.hcl index c7685f4..58f97e7 100644 --- a/windows.pkr.hcl +++ b/windows.pkr.hcl @@ -13,6 +13,11 @@ variable "volsize" { default = "50" } +variable "product_codes" { + type = string + default = "${env("OUTSCALE_PRODUCT_CODES")}" +} + packer { required_plugins { windows-update = { @@ -46,6 +51,7 @@ source "outscale-bsu" "windows" { winrm_insecure = true winrm_use_ssl = true winrm_username = "Administrator" + omi_product_codes = ["${var.product_codes}"] } build {