Skip to content

Commit

Permalink
Merge pull request #687 from ministryofjustice/DSO/DSOS-2568/fix-wind…
Browse files Browse the repository at this point in the history
…ows-2012-components

Dso/dsos 2568/fix windows 2012 components
  • Loading branch information
robertsweetman authored Jan 29, 2024
2 parents 1c32d2b + d814243 commit f1d5e1a
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 12 deletions.
11 changes: 8 additions & 3 deletions commonimages/base/windows_2012_r2/locals.tf
Original file line number Diff line number Diff line change
@@ -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 = {}
Expand Down
2 changes: 1 addition & 1 deletion commonimages/base/windows_2012_r2/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
11 changes: 8 additions & 3 deletions commonimages/base/windows_2012_r2_SQL_2014/locals.tf
Original file line number Diff line number Diff line change
@@ -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 = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions commonimages/components/templates/aws_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ 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
default: "Windows"
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
Expand Down
31 changes: 31 additions & 0 deletions commonimages/components/templates/chocolatey.yml
Original file line number Diff line number Diff line change
@@ -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)
}
28 changes: 28 additions & 0 deletions commonimages/components/templates/powershell_core_server_2012.yml
Original file line number Diff line number Diff line change
@@ -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"'
2 changes: 1 addition & 1 deletion teams/hmpps/windows_server_2022/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ locals {
},
{
name = "aws_cli"
version = "0.0.2"
version = "0.0.4"
parameters = []
},
{
Expand Down
2 changes: 1 addition & 1 deletion teams/hmpps/windows_server_2022/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit f1d5e1a

Please sign in to comment.