Skip to content

Commit 5d66158

Browse files
authored
Merge pull request #554 from Icinga:fix/custom_hostname_automated_installation_director
Fix: Automated Icinga Director installation for custom hostname Fixes certificate generation and host registration, in case a custom hostname was set during usage of `Install-Icinga` automation
2 parents 0756b47 + da31757 commit 5d66158

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

doc/100-General/10-Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
1717
* [#476](https://github.com/Icinga/icinga-powershell-framework/pull/476) Fixes exception `You cannot call a method on va null-valued expression` during installation in case no background daemon is configured
1818
* [#482](https://github.com/Icinga/icinga-powershell-framework/pull/482) Fixes encoding problems with special chars or German umlauts during plugin execution and unescaped whitespace in plugin argument strings like `Icinga for Windows`, which was previously wrongly rended as `Icinga` for example
1919
* [#489](https://github.com/Icinga/icinga-powershell-framework/issues/489) Fixes error message `This argument does not support the % unit` in case a `BaseValue` is set, but the actual value is `0`
20+
* [#505](https://github.com/Icinga/icinga-powershell-framework/issues/505) Fixes certificate generation and host registration, in case a custom hostname was set during usage of `Install-Icinga` automation
2021
* [#529](https://github.com/Icinga/icinga-powershell-framework/pull/529) Fixes package manifest reader for Icinga for Windows components on Windows 2012 R2 and older
2122
* [#523](https://github.com/Icinga/icinga-powershell-framework/pull/523) Fixes errors on encapsulated PowerShell calls for missing Cmdlets `Write-IcingaConsoleError` and `Optimize-IcingaForWindowsMemory`
2223
* [#524](https://github.com/Icinga/icinga-powershell-framework/issues/524) Fixes uninstallation process by improving the location handling of PowerShell instances with Icinga IMC or Shell

lib/core/installer/menu/installation/director/DirectorTemplate.psm1

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,25 @@ function Resolve-IcingaForWindowsManagementConsoleInstallationDirectorTemplate()
44
[switch]$Register = $FALSE
55
);
66

7-
$DirectorUrl = Get-IcingaForWindowsInstallerValuesFromStep -InstallerStep 'Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorUrl';
8-
$SelfServiceKey = Get-IcingaForWindowsInstallerValuesFromStep -InstallerStep 'Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorSelfServiceKey';
9-
$UsedEnteredKey = $SelfServiceKey;
7+
$DirectorUrl = Get-IcingaForWindowsInstallerValuesFromStep -InstallerStep 'Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorUrl';
8+
$SelfServiceKey = Get-IcingaForWindowsInstallerValuesFromStep -InstallerStep 'Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorSelfServiceKey';
9+
$HostRegisterSetting = Get-IcingaForWindowsInstallerStepSelection -InstallerStep 'Show-IcingaForWindowsInstallerMenuSelectHostname';
10+
$CustomHostname = Get-IcingaForWindowsInstallerValuesFromStep -InstallerStep 'Show-IcingaForWindowsInstallationMenuEnterCustomHostname';
11+
$UsedEnteredKey = $SelfServiceKey;
1012

1113
# Once we run this menu, we require to reset everything to have a proper state
1214
if ($Register -eq $FALSE) {
1315
$global:Icinga.InstallWizard.Config = @{ };
1416

1517
Add-IcingaForWindowsInstallerConfigEntry -Selection 'c' -Values $DirectorUrl -OverwriteValues -OverwriteMenu 'Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorUrl';
1618
Add-IcingaForWindowsInstallerConfigEntry -Selection 'c' -Values $SelfServiceKey -OverwriteValues -OverwriteMenu 'Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorSelfServiceKey';
19+
20+
if ($null -ne $HostRegisterSetting) {
21+
Add-IcingaForWindowsInstallerConfigEntry -Selection $HostRegisterSetting -OverwriteValues -OverwriteMenu 'Show-IcingaForWindowsInstallerMenuSelectHostname'
22+
if ($HostRegisterSetting -eq '6') {
23+
Add-IcingaForWindowsInstallerConfigEntry -Selection 'c' -Values $CustomHostname -OverwriteValues -OverwriteMenu 'Show-IcingaForWindowsInstallationMenuEnterCustomHostname';
24+
}
25+
}
1726
} else {
1827
$Global:Icinga.InstallWizard.DirectorRegisteredHost = $TRUE;
1928
$HostnameType = Get-IcingaForWindowsInstallerStepSelection -InstallerStep 'Show-IcingaForWindowsInstallerMenuSelectHostname';

0 commit comments

Comments
 (0)