From eb700279516de77952db553e6f7db38a75d66111 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Sun, 3 Nov 2019 17:07:47 +0100 Subject: [PATCH] Add support to install plugins during setup wizard --- .../misc/Start-IcingaAgentInstallWizard.psm1 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 b/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 index 1cd10ae..7cddad4 100644 --- a/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 +++ b/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 @@ -34,7 +34,9 @@ function Start-IcingaAgentInstallWizard() [bool]$SkipDirectorQuestion = $FALSE, [string]$DirectorUrl, [string]$SelfServiceAPIKey = $null, - $OverrideDirectorVars = $null + $OverrideDirectorVars = $null, + $InstallFrameworkPlugins = $null, + $PluginsUrl = $null ); [array]$InstallerArguments = @(); @@ -363,6 +365,17 @@ function Start-IcingaAgentInstallWizard() } } + if ($null -eq $InstallFrameworkPlugins) { + if ((Get-IcingaAgentInstallerAnswerInput -Prompt 'Do you want to install the Icinga Plugins?' -Default 'y').result -eq 1) { + $result = Install-IcingaFrameworkPlugins -PluginsUrl $PluginsUrl; + $PluginsUrl = $result.PluginsUrl; + $InstallerArguments += "-InstallFrameworkPlugins 1"; + $InstallerArguments += "-$PluginsUrl '$PluginsUrl'"; + } else { + $InstallerArguments += "-InstallFrameworkPlugins 0"; + } + } + if ($null -eq $InstallFrameworkService) { if ((Get-IcingaAgentInstallerAnswerInput -Prompt 'Do you want to install the PowerShell Framework as a Service?' -Default 'y').result -eq 1) { $result = Get-IcingaFrameworkServiceBinary;