From 824c4f2da2a0b8d6613c66a245a0d89c05a35d1d Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Thu, 9 Sep 2021 08:59:37 +0200 Subject: [PATCH] Fixes Director Self-Service no Agent install --- doc/100-General/10-Changelog.md | 8 ++++++++ .../director/DirectorTemplate.psm1 | 20 +++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/doc/100-General/10-Changelog.md b/doc/100-General/10-Changelog.md index 873412b..04df406 100644 --- a/doc/100-General/10-Changelog.md +++ b/doc/100-General/10-Changelog.md @@ -7,6 +7,14 @@ documentation before upgrading to a new release. Released closed milestones can be found on [GitHub](https://github.com/Icinga/icinga-powershell-framework/milestones?state=closed). +## 1.6.1 (2021-09-15) + +[Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/21?closed=1) + +### Bugfixes + +* [#361](https://github.com/Icinga/icinga-powershell-framework/issues/361) Fixes IMC freeze on Icinga Director Self-Service installation, in case no Agent installation set on Self-Service API config + ## 1.6.0 (2021-09-07) [Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/15?closed=1) diff --git a/lib/core/installer/menu/installation/director/DirectorTemplate.psm1 b/lib/core/installer/menu/installation/director/DirectorTemplate.psm1 index e0133ef..7c0779d 100644 --- a/lib/core/installer/menu/installation/director/DirectorTemplate.psm1 +++ b/lib/core/installer/menu/installation/director/DirectorTemplate.psm1 @@ -69,15 +69,15 @@ function Resolve-IcingaForWindowsManagementConsoleInstallationDirectorTemplate() } # No we need to identify which host selection is matching our config - $HostnameSelection = -1; - $InstallPluginsSelection = -1; - $InstallServiceSelection = -1; + $HostnameSelection = 1; + $InstallPluginsSelection = 0; + $InstallServiceSelection = 0; $WindowsFirewallSelection = 1; + $AgentVersion = 'release'; + $InstallIcingaAgent = 0; $ServiceUserName = $DirectorConfig.icinga_service_user; $AgentPackageSelection = 1; #Always use custom source - $AgentPackageSource = $DirectorConfig.download_url; - $AgentVersion = $DirectorConfig.agent_version; $IcingaPort = $DirectorConfig.agent_listen_port; $GlobalZones = @(); $IcingaParents = @(); @@ -86,6 +86,12 @@ function Resolve-IcingaForWindowsManagementConsoleInstallationDirectorTemplate() $MasterAddress = ''; $Ticket = ''; + if (Test-IcingaPowerShellConfigItem -ConfigObject $DirectorConfig -ConfigKey 'agent_version') { + $AgentVersion = $DirectorConfig.agent_version; + } else { + $InstallIcingaAgent = 1; + } + if ($DirectorUrl.ToLower().Contains('https://') -Or $DirectorUrl.ToLower().Contains('http://')) { $MasterAddress = $DirectorUrl.Split('/')[2]; } else { @@ -163,6 +169,7 @@ function Resolve-IcingaForWindowsManagementConsoleInstallationDirectorTemplate() # Do not install $InstallServiceSelection = 1; } else { + # Install the service from our repository $InstallServiceSelection = 0; } @@ -170,7 +177,7 @@ function Resolve-IcingaForWindowsManagementConsoleInstallationDirectorTemplate() # Do not install $InstallPluginsSelection = 1; } else { - # TODO: This is currently not supported. We use the "default" config for installing from GitHub by now + # Install the plugins from our repository $InstallPluginsSelection = 0; } @@ -202,6 +209,7 @@ function Resolve-IcingaForWindowsManagementConsoleInstallationDirectorTemplate() Show-IcingaForWindowsInstallerMenuSelectCertificate -Automated -DefaultInput '1'; Show-IcingaForWindowsInstallerMenuEnterIcingaTicket -Automated -Value $Ticket; + Show-IcingaForWindowsInstallerMenuSelectInstallIcingaAgent -Automated -DefaultInput $InstallIcingaAgent; Show-IcingaForWindowsInstallationMenuEnterIcingaAgentVersion -Automated -Value $AgentVersion; Show-IcingaForWindowsManagementConsoleInstallationDirectorRegisterHost -Automated;