mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Adds support for new Director SelfService config
This commit is contained in:
parent
7a509cc806
commit
0257ace1ee
3 changed files with 108 additions and 81 deletions
|
|
@ -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
|
* [#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`
|
* [#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
|
* [#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
|
### Bugfixes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,22 +9,28 @@ function Convert-IcingaDirectorSelfServiceArguments()
|
||||||
}
|
}
|
||||||
|
|
||||||
[hashtable]$DirectorArguments = @{
|
[hashtable]$DirectorArguments = @{
|
||||||
PackageSource = $JsonInput.download_url;
|
PackageSource = $JsonInput.download_url;
|
||||||
AgentVersion = $JsonInput.agent_version;
|
AgentVersion = $JsonInput.agent_version;
|
||||||
CAPort = $JsonInput.agent_listen_port;
|
CAPort = $JsonInput.agent_listen_port;
|
||||||
AllowVersionChanges = $JsonInput.allow_updates;
|
AllowVersionChanges = $JsonInput.allow_updates;
|
||||||
GlobalZones = $JsonInput.global_zones;
|
GlobalZones = $JsonInput.global_zones;
|
||||||
ParentZone = $JsonInput.parent_zone;
|
ParentZone = $JsonInput.parent_zone;
|
||||||
#CAEndpoint = $JsonInput.ca_server;
|
#CAEndpoint = $JsonInput.ca_server;
|
||||||
Endpoints = $JsonInput.parent_endpoints;
|
Endpoints = $JsonInput.parent_endpoints;
|
||||||
AddFirewallRule = $JsonInput.agent_add_firewall_rule;
|
AddFirewallRule = $JsonInput.agent_add_firewall_rule;
|
||||||
AcceptConnections = $JsonInput.agent_add_firewall_rule;
|
AcceptConnections = $JsonInput.agent_add_firewall_rule;
|
||||||
ServiceUser = $JsonInput.icinga_service_user;
|
ServiceUser = $JsonInput.icinga_service_user;
|
||||||
IcingaMaster = $JsonInput.IcingaMaster;
|
IcingaMaster = $JsonInput.IcingaMaster;
|
||||||
UpdateAgent = $TRUE;
|
InstallFrameworkService = $JsonInput.install_framework_service;
|
||||||
AddDirectorGlobal = $FALSE;
|
ServiceDirectory = $JsonInput.framework_service_directory;
|
||||||
AddGlobalTemplates = $FALSE;
|
FrameworkServiceUrl = $JsonInput.framework_service_url;
|
||||||
RunInstaller = $TRUE;
|
InstallFrameworkPlugins = $JsonInput.install_framework_plugins;
|
||||||
|
PluginsUrl = $JsonInput.framework_plugins_url;
|
||||||
|
ConvertEndpointIPConfig = $JsonInput.resolve_parent_host;
|
||||||
|
UpdateAgent = $TRUE;
|
||||||
|
AddDirectorGlobal = $FALSE;
|
||||||
|
AddGlobalTemplates = $FALSE;
|
||||||
|
RunInstaller = $TRUE;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Use NetworkService as default if nothing was transmitted by Director
|
# Use NetworkService as default if nothing was transmitted by Director
|
||||||
|
|
|
||||||
|
|
@ -68,75 +68,95 @@ function Start-IcingaAgentInstallWizard()
|
||||||
$DirectorUrl = $Result.Value;
|
$DirectorUrl = $Result.Value;
|
||||||
$InstallerArguments = $Result.Args;
|
$InstallerArguments = $Result.Args;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'SelfServiceAPIKey' -Value $SelfServiceAPIKey -InstallerArguments $InstallerArguments -Default $null;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'SelfServiceAPIKey' -Value $SelfServiceAPIKey -InstallerArguments $InstallerArguments -Default $null;
|
||||||
|
|
||||||
if ([string]::IsNullOrEmpty($Result.Value) -eq $FALSE) {
|
if ([string]::IsNullOrEmpty($Result.Value) -eq $FALSE) {
|
||||||
$SelfServiceAPIKey = $Result.Value;
|
$SelfServiceAPIKey = $Result.Value;
|
||||||
$InstallerArguments = $Result.Args;
|
$InstallerArguments = $Result.Args;
|
||||||
}
|
}
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'Ticket' -Value $Ticket -InstallerArguments $InstallerArguments;
|
|
||||||
$Ticket = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'Ticket' -Value $Ticket -InstallerArguments $InstallerArguments;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'PackageSource' -Value $PackageSource -InstallerArguments $InstallerArguments;
|
$Ticket = $Result.Value;
|
||||||
$PackageSource = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'PackageSource' -Value $PackageSource -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$PackageSource = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AgentVersion' -Value $AgentVersion -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$AgentVersion = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AgentVersion' -Value $AgentVersion -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$AgentVersion = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'InstallDir' -Value $InstallDir -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$InstallDir = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'InstallDir' -Value $InstallDir -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$InstallDir = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'CAPort' -Value $CAPort -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$CAPort = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'CAPort' -Value $CAPort -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$CAPort = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AllowVersionChanges' -Value $AllowVersionChanges -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$AllowVersionChanges = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AllowVersionChanges' -Value $AllowVersionChanges -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$AllowVersionChanges = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'GlobalZones' -Value $GlobalZones -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$GlobalZones = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'GlobalZones' -Value $GlobalZones -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$GlobalZones = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'ParentZone' -Value $ParentZone -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$ParentZone = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'ParentZone' -Value $ParentZone -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$ParentZone = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'CAEndpoint' -Value $CAEndpoint -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$CAEndpoint = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'CAEndpoint' -Value $CAEndpoint -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$CAEndpoint = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'Endpoints' -Value $Endpoints -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$Endpoints = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'Endpoints' -Value $Endpoints -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$Endpoints = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AddFirewallRule' -Value $AddFirewallRule -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$AddFirewallRule = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AddFirewallRule' -Value $AddFirewallRule -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$AddFirewallRule = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AcceptConnections' -Value $AcceptConnections -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$AcceptConnections = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AcceptConnections' -Value $AcceptConnections -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$AcceptConnections = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'ServiceUser' -Value $ServiceUser -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$ServiceUser = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'ServiceUser' -Value $ServiceUser -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$ServiceUser = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'UpdateAgent' -Value $UpdateAgent -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$UpdateAgent = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'UpdateAgent' -Value $UpdateAgent -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$UpdateAgent = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AddDirectorGlobal' -Value $AddDirectorGlobal -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$AddDirectorGlobal = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AddDirectorGlobal' -Value $AddDirectorGlobal -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$AddDirectorGlobal = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AddGlobalTemplates' -Value $AddGlobalTemplates -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$AddGlobalTemplates = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AddGlobalTemplates' -Value $AddGlobalTemplates -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$AddGlobalTemplates = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'LowerCase' -Value $LowerCase -Default $FALSE -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$LowerCase = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'LowerCase' -Value $LowerCase -Default $FALSE -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$LowerCase = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'UpperCase' -Value $UpperCase -Default $FALSE -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$UpperCase = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'UpperCase' -Value $UpperCase -Default $FALSE -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$UpperCase = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AutoUseFQDN' -Value $AutoUseFQDN -Default $FALSE -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$AutoUseFQDN = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AutoUseFQDN' -Value $AutoUseFQDN -Default $FALSE -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$AutoUseFQDN = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AutoUseHostname' -Value $AutoUseHostname -Default $FALSE -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$AutoUseHostname = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'AutoUseHostname' -Value $AutoUseHostname -Default $FALSE -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$AutoUseHostname = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'EndpointConnections' -Value $EndpointConnections -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$EndpointConnections = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'EndpointConnections' -Value $EndpointConnections -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$EndpointConnections = $Result.Value;
|
||||||
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'OverrideDirectorVars' -Value $OverrideDirectorVars -InstallerArguments $InstallerArguments;
|
$InstallerArguments = $Result.Args;
|
||||||
$OverrideDirectorVars = $Result.Value;
|
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'OverrideDirectorVars' -Value $OverrideDirectorVars -InstallerArguments $InstallerArguments;
|
||||||
$InstallerArguments = $Result.Args;
|
$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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue