diff --git a/commonimages/base/windows_2012_r2/locals.tf b/commonimages/base/windows_2012_r2/locals.tf index 3c97f017..c1e24ad0 100644 --- a/commonimages/base/windows_2012_r2/locals.tf +++ b/commonimages/base/windows_2012_r2/locals.tf @@ -1,15 +1,20 @@ locals { components_common = [ { - name = "powershell_core" - version = "0.3.0" + name = "chocolatey" + version = "0.0.4" parameters = [] }, { - name = "aws_cli" + name = "powershell_core_server_2012" version = "0.0.3" parameters = [] }, + { + name = "aws_cli" + version = "0.0.4" + parameters = [] + }, ] component_template_args = {} diff --git a/commonimages/base/windows_2012_r2/terraform.tfvars b/commonimages/base/windows_2012_r2/terraform.tfvars index 149b5432..f2512781 100644 --- a/commonimages/base/windows_2012_r2/terraform.tfvars +++ b/commonimages/base/windows_2012_r2/terraform.tfvars @@ -4,7 +4,7 @@ region = "eu-west-2" ami_base_name = "windows_server_2012_r2" -configuration_version = "0.1.3" +configuration_version = "0.1.9" release_or_patch = "release" # or "patch", see nomis AMI image building strategy doc description = "Windows Server 2012 R2" diff --git a/commonimages/base/windows_2012_r2_SQL_2014/locals.tf b/commonimages/base/windows_2012_r2_SQL_2014/locals.tf index 5b7f1214..35d8a610 100644 --- a/commonimages/base/windows_2012_r2_SQL_2014/locals.tf +++ b/commonimages/base/windows_2012_r2_SQL_2014/locals.tf @@ -1,15 +1,20 @@ locals { components_common = [ { - name = "powershell_core" - version = "0.3.0" + name = "chocolatey" + version = "0.0.4" parameters = [] }, { - name = "aws_cli" + name = "powershell_core_server_2012" version = "0.0.3" parameters = [] }, + { + name = "aws_cli" + version = "0.0.4" + parameters = [] + }, ] component_template_args = {} diff --git a/commonimages/base/windows_2012_r2_SQL_2014/terraform.tfvars b/commonimages/base/windows_2012_r2_SQL_2014/terraform.tfvars index 41f67890..bc188b1d 100644 --- a/commonimages/base/windows_2012_r2_SQL_2014/terraform.tfvars +++ b/commonimages/base/windows_2012_r2_SQL_2014/terraform.tfvars @@ -4,7 +4,7 @@ region = "eu-west-2" ami_base_name = "windows_server_2012_r2_SQL_2014_enterprise" -configuration_version = "0.0.7" +configuration_version = "0.0.8" release_or_patch = "release" # or "patch", see nomis AMI image building strategy doc description = "Windows Server 2012 R2 with SQL 2014 Enterprise" diff --git a/commonimages/components/templates/aws_cli.yml b/commonimages/components/templates/aws_cli.yml index 310c643b..d3d3a1e5 100644 --- a/commonimages/components/templates/aws_cli.yml +++ b/commonimages/components/templates/aws_cli.yml @@ -5,7 +5,7 @@ schemaVersion: 1.0 parameters: - Version: type: string - default: 0.0.3 + default: 0.0.4 description: Component version (update this each time the file changes) - Platform: type: string @@ -13,7 +13,7 @@ parameters: description: Platform. - AwsCliVersion: type: string - default: 2.13.14 + default: 2.15.14 description: Version of the AWS Cli v2 to install phases: - name: build diff --git a/commonimages/components/templates/chocolatey.yml b/commonimages/components/templates/chocolatey.yml new file mode 100644 index 00000000..941362ae --- /dev/null +++ b/commonimages/components/templates/chocolatey.yml @@ -0,0 +1,31 @@ +--- +name: chocolatey +description: Component to install chocolatey +schemaVersion: 1.0 +parameters: + - Version: + type: string + default: 0.0.4 + description: Component version (update this each time the file changes) + - Platform: + type: string + default: "Windows" + description: Platform. +phases: + - name: build + steps: + - name: InstallChocolatey + action: ExecutePowerShell + inputs: + commands: + - | + if (Get-Command choco.exe -ErrorAction SilentlyContinue) { + Write-Host "Chocolatey already installed" + [System.Environment]::Exit(0) + } else { + Write-Host "Installing Chocolatey" + Set-ExecutionPolicy Bypass -Scope Process -Force + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072 + Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + [System.Environment]::Exit(3010) + } diff --git a/commonimages/components/templates/powershell_core_server_2012.yml b/commonimages/components/templates/powershell_core_server_2012.yml new file mode 100644 index 00000000..0457a3d8 --- /dev/null +++ b/commonimages/components/templates/powershell_core_server_2012.yml @@ -0,0 +1,28 @@ +--- +name: powershell_core_server_2012 +description: Component to install PowerShell Core on Windows Server 2012, has different command line flags as there are not supported packages for this version since Windows Server 2012 r2 is nearing EOL +schemaVersion: 1.0 +parameters: + - Version: + type: string + default: 0.0.3 + description: Component version (update this each time the file changes) + - Platform: + type: string + default: "Windows" + description: Platform. + - PowerShellCoreVersion: + type: string + default: 7.4.1 + description: Version of the PowerShell Core to install +phases: + - name: build + steps: + - name: InstallPowerShellCore + action: ExecutePowerShell + inputs: + commands: + - | + choco install -y chocolatey-core.extension + choco install -y kb3118401 + choco install -y powershell-core --version '{{ PowerShellCoreVersion }}' --install-arguments='"ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 USE_MU=0 ENABLE_MU=0 ADD_PATH=1 DISABLE_TELEMETRY"' diff --git a/teams/hmpps/windows_server_2022/locals.tf b/teams/hmpps/windows_server_2022/locals.tf index 2d3c2578..764245a7 100644 --- a/teams/hmpps/windows_server_2022/locals.tf +++ b/teams/hmpps/windows_server_2022/locals.tf @@ -7,7 +7,7 @@ locals { }, { name = "aws_cli" - version = "0.0.2" + version = "0.0.4" parameters = [] }, { diff --git a/teams/hmpps/windows_server_2022/terraform.tfvars b/teams/hmpps/windows_server_2022/terraform.tfvars index 8ec8dfef..eae979b1 100644 --- a/teams/hmpps/windows_server_2022/terraform.tfvars +++ b/teams/hmpps/windows_server_2022/terraform.tfvars @@ -5,7 +5,7 @@ region = "eu-west-2" ami_name_prefix = "hmpps" ami_base_name = "windows_server_2022" -configuration_version = "0.1.4" +configuration_version = "0.1.8" release_or_patch = "release" # or "patch", see nomis AMI image building strategy doc description = "windows server 2022"