Fixes missing Icinga CA Ticket handling

This commit is contained in:
Lord Hepipud 2019-11-03 19:47:42 +01:00
parent 011cf54d1c
commit 64458d2bcb
2 changed files with 7 additions and 3 deletions

View file

@ -51,9 +51,6 @@ function Start-IcingaAgentDirectorWizard()
}
if ($HostKnown -eq $FALSE) {
Write-Host $SelfServiceAPIKey;
Write-Host (Get-IcingaHostname @Arguments);
Write-Host $DirectorUrl;
$SelfServiceAPIKey = Register-IcingaDirectorSelfServiceHost -DirectorUrl $DirectorUrl -ApiKey $SelfServiceAPIKey -Hostname (Get-IcingaHostname @Arguments);
# Host is already registered
@ -74,9 +71,14 @@ function Start-IcingaAgentDirectorWizard()
}
}
$IcingaTicket = Get-IcingaDirectorSelfServiceTicket -DirectorUrl $DirectorUrl -ApiKey $SelfServiceAPIKey;
$DirectorOverrideArgs.Add(
'DirectorUrl', $DirectorUrl
);
$DirectorOverrideArgs.Add(
'Ticket', $IcingaTicket
);
if ([string]::IsNullOrEmpty($TemplateKey) -eq $FALSE) {
$DirectorOverrideArgs.Add(
'SelfServiceAPIKey', $TemplateKey

View file

@ -70,6 +70,8 @@ function Start-IcingaAgentInstallWizard()
$SelfServiceAPIKey = $Result.Value;
$InstallerArguments = $Result.Args;
}
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'Ticket' -Value $Ticket -InstallerArguments $InstallerArguments;
$Ticket = $Result.Value;
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'PackageSource' -Value $PackageSource -InstallerArguments $InstallerArguments;
$PackageSource = $Result.Value;
$InstallerArguments = $Result.Args;