From 9746631e97fa0f0e84defb8f124045cea5416bc5 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Sun, 3 Nov 2019 19:47:42 +0100 Subject: [PATCH] Fixes missing Icinga CA Ticket handling --- .../icingaagent/misc/Start-IcingaAgentDirectorWizard.psm1 | 8 +++++--- .../icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/core/icingaagent/misc/Start-IcingaAgentDirectorWizard.psm1 b/lib/core/icingaagent/misc/Start-IcingaAgentDirectorWizard.psm1 index b8ad7a2..855e894 100644 --- a/lib/core/icingaagent/misc/Start-IcingaAgentDirectorWizard.psm1 +++ b/lib/core/icingaagent/misc/Start-IcingaAgentDirectorWizard.psm1 @@ -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 diff --git a/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 b/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 index 837fbf8..e7083b0 100644 --- a/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 +++ b/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 @@ -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;