mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Merge pull request #341 from Icinga:fix/various_director_imc_fixes
Fix: Various issues with Icinga Director on IMC Adds various fixes and improvements for the Icinga Director Self-Service API while using IMC.
This commit is contained in:
commit
25578d0d50
5 changed files with 44 additions and 23 deletions
|
|
@ -17,6 +17,8 @@ function Install-Icinga()
|
||||||
'LastNotice' = '';
|
'LastNotice' = '';
|
||||||
'LastError' = '';
|
'LastError' = '';
|
||||||
'HeaderPreview' = '';
|
'HeaderPreview' = '';
|
||||||
|
'DirectorSelfService' = $FALSE;
|
||||||
|
'DirectorRegisteredHost' = $FALSE;
|
||||||
'LastParent' = [System.Collections.ArrayList]@();
|
'LastParent' = [System.Collections.ArrayList]@();
|
||||||
'LastValues' = @();
|
'LastValues' = @();
|
||||||
'Config' = @{ };
|
'Config' = @{ };
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ function Resolve-IcingaForWindowsManagementConsoleInstallationDirectorTemplate()
|
||||||
Add-IcingaForWindowsInstallerConfigEntry -Selection 'c' -Values $DirectorUrl -OverwriteValues -OverwriteMenu 'Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorUrl';
|
Add-IcingaForWindowsInstallerConfigEntry -Selection 'c' -Values $DirectorUrl -OverwriteValues -OverwriteMenu 'Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorUrl';
|
||||||
Add-IcingaForWindowsInstallerConfigEntry -Selection 'c' -Values $SelfServiceKey -OverwriteValues -OverwriteMenu 'Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorSelfServiceKey';
|
Add-IcingaForWindowsInstallerConfigEntry -Selection 'c' -Values $SelfServiceKey -OverwriteValues -OverwriteMenu 'Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorSelfServiceKey';
|
||||||
} else {
|
} else {
|
||||||
|
$Global:Icinga.InstallWizard.DirectorRegisteredHost = $TRUE;
|
||||||
$HostnameType = Get-IcingaForWindowsInstallerStepSelection -InstallerStep 'Show-IcingaForWindowsInstallerMenuSelectHostname';
|
$HostnameType = Get-IcingaForWindowsInstallerStepSelection -InstallerStep 'Show-IcingaForWindowsInstallerMenuSelectHostname';
|
||||||
$Hostname = '';
|
$Hostname = '';
|
||||||
|
|
||||||
|
|
@ -76,7 +77,7 @@ function Resolve-IcingaForWindowsManagementConsoleInstallationDirectorTemplate()
|
||||||
$ServiceUserName = $DirectorConfig.icinga_service_user;
|
$ServiceUserName = $DirectorConfig.icinga_service_user;
|
||||||
$AgentPackageSelection = 1; #Always use custom source
|
$AgentPackageSelection = 1; #Always use custom source
|
||||||
$AgentPackageSource = $DirectorConfig.download_url;
|
$AgentPackageSource = $DirectorConfig.download_url;
|
||||||
$AgentVersion = $DirectorConfig.release;
|
$AgentVersion = $DirectorConfig.agent_version;
|
||||||
$IcingaPort = $DirectorConfig.agent_listen_port;
|
$IcingaPort = $DirectorConfig.agent_listen_port;
|
||||||
$GlobalZones = @();
|
$GlobalZones = @();
|
||||||
$IcingaParents = @();
|
$IcingaParents = @();
|
||||||
|
|
@ -174,6 +175,13 @@ function Resolve-IcingaForWindowsManagementConsoleInstallationDirectorTemplate()
|
||||||
}
|
}
|
||||||
|
|
||||||
Disable-IcingaFrameworkConsoleOutput;
|
Disable-IcingaFrameworkConsoleOutput;
|
||||||
|
|
||||||
|
$HostRegisterSetting = (Get-IcingaForWindowsInstallerStepSelection -InstallerStep 'Show-IcingaForWindowsInstallerMenuSelectHostname');
|
||||||
|
|
||||||
|
if ($null -ne $HostRegisterSetting -And $HostnameSelection -ne $HostRegisterSetting) {
|
||||||
|
$HostnameSelection = $HostRegisterSetting;
|
||||||
|
}
|
||||||
|
|
||||||
Show-IcingaForWindowsInstallerMenuSelectHostname -DefaultInput $HostnameSelection -Automated;
|
Show-IcingaForWindowsInstallerMenuSelectHostname -DefaultInput $HostnameSelection -Automated;
|
||||||
Add-IcingaForWindowsInstallationAdvancedEntries;
|
Add-IcingaForWindowsInstallationAdvancedEntries;
|
||||||
Disable-IcingaFrameworkConsoleOutput;
|
Disable-IcingaFrameworkConsoleOutput;
|
||||||
|
|
@ -194,6 +202,8 @@ function Resolve-IcingaForWindowsManagementConsoleInstallationDirectorTemplate()
|
||||||
Show-IcingaForWindowsInstallerMenuSelectCertificate -Automated -DefaultInput '1';
|
Show-IcingaForWindowsInstallerMenuSelectCertificate -Automated -DefaultInput '1';
|
||||||
Show-IcingaForWindowsInstallerMenuEnterIcingaTicket -Automated -Value $Ticket;
|
Show-IcingaForWindowsInstallerMenuEnterIcingaTicket -Automated -Value $Ticket;
|
||||||
|
|
||||||
|
Show-IcingaForWindowsInstallationMenuEnterIcingaAgentVersion -Automated -Value $AgentVersion;
|
||||||
|
|
||||||
Show-IcingaForWindowsManagementConsoleInstallationDirectorRegisterHost -Automated;
|
Show-IcingaForWindowsManagementConsoleInstallationDirectorRegisterHost -Automated;
|
||||||
|
|
||||||
Enable-IcingaFrameworkConsoleOutput;
|
Enable-IcingaFrameworkConsoleOutput;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ function Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorUrl()
|
||||||
[switch]$Advanced = $FALSE
|
[switch]$Advanced = $FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$Global:Icinga.InstallWizard.DirectorSelfService = $TRUE;
|
||||||
|
|
||||||
Show-IcingaForWindowsInstallerMenu `
|
Show-IcingaForWindowsInstallerMenu `
|
||||||
-Header 'Please enter the URL pointing to your Icinga Director module:' `
|
-Header 'Please enter the URL pointing to your Icinga Director module:' `
|
||||||
-Entries @(
|
-Entries @(
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
function Show-IcingaForWindowsInstallerMenuFinishInstaller()
|
function Show-IcingaForWindowsInstallerMenuFinishInstaller()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if ($global:Icinga.InstallWizard.DirectorSelfService -eq $TRUE -And $global:Icinga.InstallWizard.DirectorRegisteredHost -eq $FALSE) {
|
||||||
|
$global:Icinga.InstallWizard.LastNotice = 'To install this host while using "Icinga Director Self-Service API", you need to register the host in the previous step first.';
|
||||||
|
}
|
||||||
|
|
||||||
Show-IcingaForWindowsInstallerMenu `
|
Show-IcingaForWindowsInstallerMenu `
|
||||||
-Header 'How you do want to proceed:' `
|
-Header 'How you do want to proceed:' `
|
||||||
-Entries @(
|
-Entries @(
|
||||||
|
|
@ -7,7 +12,7 @@ function Show-IcingaForWindowsInstallerMenuFinishInstaller()
|
||||||
'Caption' = 'Start installation';
|
'Caption' = 'Start installation';
|
||||||
'Command' = 'Start-IcingaForWindowsInstallation';
|
'Command' = 'Start-IcingaForWindowsInstallation';
|
||||||
'Help' = 'Apply the just configured configuration and install components as selected';
|
'Help' = 'Apply the just configured configuration and install components as selected';
|
||||||
'Disabled' = (-Not ($global:Icinga.InstallWizard.AdminShell));
|
'Disabled' = (-Not ($global:Icinga.InstallWizard.AdminShell) -Or ($global:Icinga.InstallWizard.DirectorSelfService -eq $TRUE -And $global:Icinga.InstallWizard.DirectorRegisteredHost -eq $FALSE));
|
||||||
'Action' = @{
|
'Action' = @{
|
||||||
'Command' = 'Clear-IcingaForWindowsManagementConsolePaginationCache';
|
'Command' = 'Clear-IcingaForWindowsManagementConsolePaginationCache';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ function Show-IcingaForWindowsInstallerMenuSelectConnection()
|
||||||
[switch]$Advanced = $FALSE
|
[switch]$Advanced = $FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$Global:Icinga.InstallWizard.DirectorSelfService = $FALSE;
|
||||||
|
|
||||||
Show-IcingaForWindowsInstallerMenu `
|
Show-IcingaForWindowsInstallerMenu `
|
||||||
-Header 'How do you want to configure your local Icinga Agent?' `
|
-Header 'How do you want to configure your local Icinga Agent?' `
|
||||||
-Entries @(
|
-Entries @(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue