Add support to install plugins during setup wizard

This commit is contained in:
Lord Hepipud 2019-11-03 17:07:47 +01:00
parent 2977fb766a
commit fd14634ffa

View file

@ -34,7 +34,9 @@ function Start-IcingaAgentInstallWizard()
[bool]$SkipDirectorQuestion = $FALSE, [bool]$SkipDirectorQuestion = $FALSE,
[string]$DirectorUrl, [string]$DirectorUrl,
[string]$SelfServiceAPIKey = $null, [string]$SelfServiceAPIKey = $null,
$OverrideDirectorVars = $null $OverrideDirectorVars = $null,
$InstallFrameworkPlugins = $null,
$PluginsUrl = $null
); );
[array]$InstallerArguments = @(); [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 ($null -eq $InstallFrameworkService) {
if ((Get-IcingaAgentInstallerAnswerInput -Prompt 'Do you want to install the PowerShell Framework as a Service?' -Default 'y').result -eq 1) { if ((Get-IcingaAgentInstallerAnswerInput -Prompt 'Do you want to install the PowerShell Framework as a Service?' -Default 'y').result -eq 1) {
$result = Get-IcingaFrameworkServiceBinary; $result = Get-IcingaFrameworkServiceBinary;