Closed Bug 1563259 Opened 6 years ago Closed 6 years ago

[Windows AWS CI] Set default profile for AWS instances

Categories

(Infrastructure & Operations :: RelOps: Windows OS, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: markco, Assigned: markco)

References

Details

Currently in https://github.com/mozilla-releng/OpenCloudConfig/blob/master/userdata/OCC-Bootstrap.psm1

function Set-DefaultProfileProperties {
param (
[string] $path = 'C:\Users\Default\NTUSER.DAT',
[object[]] $entries = @(
New-Object PSObject -Property @{
Key = 'Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects';
ValueName = 'VisualFXSetting';
ValueType = 'DWord';
ValueData = 1
}
)
)
begin {
Write-Log -message ('{0} :: begin - {1:o}' -f $($MyInvocation.MyCommand.Name), (Get-Date).ToUniversalTime()) -severity 'DEBUG'
}
process {
try {
Import-RegistryHive -File $path -Key 'HKLM\TEMP_HIVE' -Name TempHive
foreach ($entry in $entries) {
if (-not (Test-Path -Path ('TempHive:{0}' -f $entry.Key) -ErrorAction SilentlyContinue)) {
New-Item -Path ('TempHive:{0}' -f $entry.Key) -Force
Write-Log -message ('{0} :: {1} created' -f $($MyInvocation.MyCommand.Name), $entry.Key) -severity 'DEBUG'
}
New-ItemProperty -Path ('TempHive:{0}' -f $entry.Key) -Name $entry.ValueName -PropertyType $entry.ValueType -Value $entry.ValueData
Write-Log -message ('{0} :: {1}{2} set to {3}' -f $($MyInvocation.MyCommand.Name), $entry.Key, $entry.ValueName, $entry.ValueData) -severity 'DEBUG'
}
$attempt = 0 # attempt Remove-RegistryHive up to 3 times
while($attempt -le 3) {
try {
$attempt++
Remove-RegistryHive -Name TempHive
Write-Log -message ('{0} :: temporary hive unloaded' -f $($MyInvocation.MyCommand.Name)) -severity 'DEBUG'
break
}
catch {
if ($attempt -eq 3) {
throw
}
Write-Log -message ('{0} :: temporary hive unload failed. retrying...' -f $($MyInvocation.MyCommand.Name)) -severity 'ERROR'
Start-Sleep -Milliseconds 100
[System.GC]::Collect()
}
}
}
catch {
Write-Log -message ('{0} :: failed to set default profile properties. {1}' -f $($MyInvocation.MyCommand.Name), $_.Exception.Message) -severity 'ERROR'
}
}
end {
Write-Log -message ('{0} :: end - {1:o}' -f $($MyInvocation.MyCommand.Name), (Get-Date).ToUniversalTime()) -severity 'DEBUG'
}
}

Which calls Import-RegistryHive and Remove-RegistryHive ,https://github.com/mozilla-releng/OpenCloudConfig/blob/4d397b22539de38e463dafbf1eca516ed496ff08/userdata/OCC-Bootstrap.psm1#L1114 .

Blocks: 1559443

This should be handled by the CI during build and capture of the golden image.

Component: RelOps: Puppet → RelOps: Windows OS
QA Contact: mcornmesser
Summary: [Ronin Windows] Set default profile for AWS instances → [Windows AWS CI] Set default profile for AWS instances
Blocks: 1567214

At this time Ronin Puppet will not support Windows AWS.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.