Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved lab deployment on Azure #179

Merged
merged 19 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ccf304d
Changed order
raandree Feb 24, 2024
a6681b8
Update Azure DevOps ISO path to version 2022.2
raandree Dec 30, 2024
58a9ea1
Change error action in PowerShell5Compatibility task to stop on failure
raandree Dec 30, 2024
b39b6c3
Update PSDesiredStateConfiguration module version to 2.0.7
raandree Dec 30, 2024
003df56
Add Azure role size and update Azure DevOps ISO path to version 2022.2
raandree Jan 1, 2025
4dc8b52
Update Azure properties and increase memory for DSCHost01 in lab conf…
raandree Jan 2, 2025
f7afc4b
Add parameter for lab name and improve lab import error handling
raandree Jan 2, 2025
fd7aea3
Changed order
raandree Feb 24, 2024
9fd1afb
Update Azure DevOps ISO path to version 2022.2
raandree Dec 30, 2024
1f3dde2
Change error action in PowerShell5Compatibility task to stop on failure
raandree Dec 30, 2024
4793975
Add Azure role size and update Azure DevOps ISO path to version 2022.2
raandree Jan 1, 2025
8b122d5
Update Azure properties and increase memory for DSCHost01 in lab conf…
raandree Jan 2, 2025
1e69f21
Add parameter for lab name and improve lab import error handling
raandree Jan 2, 2025
567d07a
Solving merge conflict
raandree Jan 2, 2025
85afacb
Killing lab PSSessions
raandree Jan 4, 2025
481e59a
Using standard port for AzDo
raandree Jan 4, 2025
db3330d
Using standard port for AzDo
raandree Jan 4, 2025
15c0cd0
Update copyright year in LICENSE file
raandree Jan 21, 2025
2a378d2
Enhance PowerShell5Compatibility script to check for existence of 'PS…
raandree Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .build/PowerShell5Compatibility.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
task PowerShell5Compatibility -if ($PSVersionTable.PSEdition -eq 'Desktop') {

Remove-Item -Path $requiredModulesPath\PSDesiredStateConfiguration -ErrorAction SilentlyContinue -Recurse -Force
Write-Warning "'PSDesiredStateConfiguration' > 2.0 module is not supported on Windows PowerShell and not required for DSC compilation."
Write-Warning "'PSDesiredStateConfiguration' was removed from the 'RequiredModules' folder."
$path = "$requiredModulesPath\PSDesiredStateConfiguration"
if (Test-Path -Path $path)
{
Remove-Item -Path $path -ErrorAction Stop -Recurse -Force
Write-Warning "'PSDesiredStateConfiguration' > 2.0 module is not supported on Windows PowerShell and not required for DSC compilation."
Write-Warning "'PSDesiredStateConfiguration' was removed from the 'RequiredModules' folder."
}
else
{
Write-Host "Module 'PSDesiredStateConfiguration' > 2.0 module has already been removed."
}

}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Raimund Andrée, Jan-Hendrik Peters
Copyright (c) 2025 Raimund Andrée, Jan-Hendrik Peters, Gael Colas

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 5 additions & 3 deletions Lab/10 Azure Full Lab with DSC and AzureDevOps.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
$labName = "DscWorkshop_$((1..6 | ForEach-Object { [char[]](97..122) | Get-Random }) -join '')"
$azureLocation = 'West Europe'
$azureRoleSize = 'Standard_D8alds_v6'

#--------------------------------------------------------------------------------------------------------------------
#----------------------- CHANGING ANYTHING BEYOND THIS LINE SHOULD NOT BE REQUIRED ----------------------------------
Expand All @@ -21,7 +22,7 @@ Add-LabDomainDefinition -Name contoso.com -AdminUser Install -AdminPassword Some
Set-LabInstallationCredential -Username Install -Password Somepass1

# Add the reference to our necessary ISO files
Add-LabIsoImageDefinition -Name AzDevOps -Path $labSources\ISOs\azuredevops2022.0.1.iso #from https://docs.microsoft.com/en-us/azure/devops/server/download/azuredevopsserver?view=azure-devops
Add-LabIsoImageDefinition -Name AzDevOps -Path $labSources\ISOs\azuredevops2022.2.iso #from https://docs.microsoft.com/en-us/azure/devops/server/download/azuredevopsserver?view=azure-devops

# Data Disks
Add-LabDiskDefinition -Name DSCDO01_D -DiskSizeInGb 120 -Label DataDisk1 -DriveLetter D
Expand All @@ -34,6 +35,7 @@ $PSDefaultParameterValues = @{
'Add-LabMachineDefinition:DomainName' = 'contoso.com'
'Add-LabMachineDefinition:DnsServer1' = '192.168.111.10'
'Add-LabMachineDefinition:OperatingSystem' = 'Windows Server 2022 Datacenter (Desktop Experience)'
'Add-LabMachineDefinition:AzureProperties' = @{ 'StorageSku' = 'Premium_LRS' }
}

#The PostInstallationActivity is just creating some users
Expand Down Expand Up @@ -66,7 +68,7 @@ $roles = @(
Get-LabMachineRoleDefinition -Role TfsBuildWorker -Properties @{ NumberOfBuildWorkers = '4' }
Get-LabMachineRoleDefinition -Role HyperV
)
Add-LabMachineDefinition -Name DSCHost01 -Memory 8GB -Roles $roles -IpAddress 192.168.111.80 -DiskName DSCHost01_D -AzureProperties @{RoleSize = 'Standard_D4s_v3' }
Add-LabMachineDefinition -Name DSCHost01 -Memory 16GB -Roles $roles -IpAddress 192.168.111.80 -DiskName DSCHost01_D

# DSC target nodes - our legacy VMs with an existing configuration
Add-LabMachineDefinition -Name DSCFile01 -Memory 1GB -Roles FileServer -IpAddress 192.168.111.100
Expand All @@ -80,7 +82,7 @@ Add-LabMachineDefinition -Name DSCWeb02 -Memory 1GB -Roles WebServer -IpAddress
Add-LabMachineDefinition -Name DSCFile03 -Memory 1GB -Roles FileServer -IpAddress 192.168.111.120
Add-LabMachineDefinition -Name DSCWeb03 -Memory 1GB -Roles WebServer -IpAddress 192.168.111.121

Install-Lab
Install-Lab -NoValidation

Enable-LabCertificateAutoenrollment -Computer -User
Install-LabWindowsFeature -ComputerName (Get-LabVM -Role DSCPullServer, FileServer, WebServer, AzDevOps) -FeatureName RSAT-AD-Tools
Expand Down
2 changes: 1 addition & 1 deletion Lab/10 HyperV Full Lab with DSC and AzureDevOps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Add-LabDomainDefinition -Name contoso.com -AdminUser Install -AdminPassword Some
Set-LabInstallationCredential -Username Install -Password Somepass1

# Add the reference to our necessary ISO files
Add-LabIsoImageDefinition -Name AzDevOps -Path $labSources\ISOs\azuredevops2022.0.1.iso #from https://docs.microsoft.com/en-us/azure/devops/server/download/azuredevopsserver?view=azure-devops
Add-LabIsoImageDefinition -Name AzDevOps -Path $labSources\ISOs\azuredevops2022.2.iso #from https://docs.microsoft.com/en-us/azure/devops/server/download/azuredevopsserver?view=azure-devops
Add-LabIsoImageDefinition -Name SQLServer2019 -Path $labsources\ISOs\SQLServer2019-x64-ENU.iso #from https://www.microsoft.com/en-us/evalcenter/evaluate-sql-server-2019. The EXE downloads the ISO.

# Data Disks
Expand Down
Loading