Adds support for new Director SelfService config

This commit is contained in:
Lord Hepipud 2020-11-25 10:17:59 +01:00
parent 7a509cc806
commit 0257ace1ee
3 changed files with 108 additions and 81 deletions

View file

@ -27,6 +27,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
* [#162](https://github.com/Icinga/icinga-powershell-framework/pull/162) Adds feature to test the length of plugin custom variables during config generation and throws error in case the total length is bigger than 64 digits, as imports into the Icinga Director by using baskets is not possible otherwise
* [#163](https://github.com/Icinga/icinga-powershell-framework/pull/163) Adds native support for writing Icinga 2 configuration for plugins and allows to easy publish new configurations for modules with the new Cmdlet `Publish-IcingaPluginConfiguration`
* [#164](https://github.com/Icinga/icinga-powershell-framework/pull/164) Adds `exit` after calling `icinga` on Windows Terminal integration to ensure the shell will close in case the Icinga shell is closed
* [#168](https://github.com/Icinga/icinga-powershell-framework/pull/168) Adds support for new Icinga Director SelfService config arguments which will now ensure the wizard will run without asking questions by using the Icinga Director configuration (requires Icinga Director 1.8 or later)
### Bugfixes

View file

@ -21,6 +21,12 @@ function Convert-IcingaDirectorSelfServiceArguments()
AcceptConnections = $JsonInput.agent_add_firewall_rule;
ServiceUser = $JsonInput.icinga_service_user;
IcingaMaster = $JsonInput.IcingaMaster;
InstallFrameworkService = $JsonInput.install_framework_service;
ServiceDirectory = $JsonInput.framework_service_directory;
FrameworkServiceUrl = $JsonInput.framework_service_url;
InstallFrameworkPlugins = $JsonInput.install_framework_plugins;
PluginsUrl = $JsonInput.framework_plugins_url;
ConvertEndpointIPConfig = $JsonInput.resolve_parent_host;
UpdateAgent = $TRUE;
AddDirectorGlobal = $FALSE;
AddGlobalTemplates = $FALSE;

View file

@ -68,10 +68,12 @@ function Start-IcingaAgentInstallWizard()
$DirectorUrl = $Result.Value;
$InstallerArguments = $Result.Args;
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'SelfServiceAPIKey' -Value $SelfServiceAPIKey -InstallerArguments $InstallerArguments -Default $null;
if ([string]::IsNullOrEmpty($Result.Value) -eq $FALSE) {
$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;
@ -137,6 +139,24 @@ function Start-IcingaAgentInstallWizard()
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'OverrideDirectorVars' -Value $OverrideDirectorVars -InstallerArguments $InstallerArguments;
$OverrideDirectorVars = $Result.Value;
$InstallerArguments = $Result.Args;
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'InstallFrameworkService' -Value $InstallFrameworkService -InstallerArguments $InstallerArguments;
$InstallFrameworkService = $Result.Value;
$InstallerArguments = $Result.Args;
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'ServiceDirectory' -Value $ServiceDirectory -InstallerArguments $InstallerArguments;
$ServiceDirectory = $Result.Value;
$InstallerArguments = $Result.Args;
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'FrameworkServiceUrl' -Value $FrameworkServiceUrl -InstallerArguments $InstallerArguments;
$FrameworkServiceUrl = $Result.Value;
$InstallerArguments = $Result.Args;
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'InstallFrameworkPlugins' -Value $InstallFrameworkPlugins -InstallerArguments $InstallerArguments;
$InstallFrameworkPlugins = $Result.Value;
$InstallerArguments = $Result.Args;
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'PluginsUrl' -Value $PluginsUrl -InstallerArguments $InstallerArguments;
$PluginsUrl = $Result.Value;
$InstallerArguments = $Result.Args;
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'ConvertEndpointIPConfig' -Value $ConvertEndpointIPConfig -InstallerArguments $InstallerArguments;
$ConvertEndpointIPConfig = $Result.Value;
$InstallerArguments = $Result.Args;
}
}