Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/100-General/10-Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
### Bugfixes

* [#472](https://github.com/Icinga/icinga-powershell-framework/pull/472) Fixes random errors while dynamically compiling Add-Type code by now writing a DLL inside `cache/dll` for later usage
* [#478](https://github.com/Icinga/icinga-powershell-framework/pull/478) Fixes connection option "Connecting from parent system" which is not asking for ca.crt location

### Enhancements

Expand Down
6 changes: 5 additions & 1 deletion lib/core/installer/menu/installation/AdvancedEntries.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ function Add-IcingaForWindowsInstallationAdvancedEntries()

Show-IcingaForWindowsInstallationMenuEnterIcingaPort -Automated -Advanced;
Show-IcingaForWindowsInstallerMenuSelectOpenWindowsFirewall -DefaultInput $OpenFirewall -Automated -Advanced;
Show-IcingaForWindowsInstallerMenuSelectCertificate -Automated -Advanced;
# Only apply the certificate menu in case it was not selected previously, if
# we choose IfW-Connection 1 for example, which tells the Parent to connect to Agent only
if ($null -eq (Get-IcingaForWindowsInstallerStepSelection -InstallerStep 'Show-IcingaForWindowsInstallerMenuSelectCertificate')) {
Show-IcingaForWindowsInstallerMenuSelectCertificate -Automated -Advanced;
}
Show-IcingaForWindowsInstallerMenuSelectForceCertificateGeneration -Automated -Advanced;
Show-IcingaForWindowsInstallerMenuSelectGlobalZones -Automated -Advanced;
Show-IcingaForWindowsInstallationMenuEnterCustomGlobalZones -Automated -Advanced;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ function Show-IcingaForWindowsInstallerMenuEnterIcingaCAFile()
-ConfigElement `
-Automated:$Automated `
-Advanced:$Advanced;

# By default, we are never prompt to enter the CA target path, unless we are connecting
# from Parent->Agent, which is option 1 von IfW-Connection
# In case we run this configuration, we are forwarded from that menu to here and require
# to enter the hostname in addition
if ((Test-IcingaForWindowsManagementConsoleContinue) -And $JumpToSummary -eq $FALSE) {
$global:Icinga.InstallWizard.NextCommand = 'Show-IcingaForWindowsInstallerMenuSelectHostname';
}
}

Set-Alias -Name 'IfW-CAFile' -Value 'Show-IcingaForWindowsInstallerMenuEnterIcingaCAFile';
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ function Show-IcingaForWindowsInstallerMenuSelectCertificate()
break;
};
}

# By Default, we are not jumping to the Summary on this menu but will require this in case
# we choose CAFile selection and are on the summary page, as then we do not want to be prompted
# for the Hostname again and require to tell the CA menu, that we should directly move to the
# summary page again
$LastInput = Get-IcingaForWindowsManagementConsoleLastInput;

if ($LastInput -eq '2' -And $JumpToSummary) {
$global:Icinga.InstallWizard.NextCommand = 'Show-IcingaForWindowsInstallerMenuEnterIcingaCAFile';
$global:Icinga.InstallWizard.NextArguments = @{ 'JumpToSummary' = $TRUE; };
}
}

Set-Alias -Name 'IfW-Certificate' -Value 'Show-IcingaForWindowsInstallerMenuSelectCertificate';
20 changes: 18 additions & 2 deletions lib/core/installer/menu/installation/icinga/SelectConnection.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ function Show-IcingaForWindowsInstallerMenuSelectConnection()
},
@{
'Caption' = 'Connecting from parent system';
'Command' = 'Show-IcingaForWindowsInstallerMenuSelectHostname';
'Help' = 'Choose this option if the Icinga Agent should not or cannot connect to a parent Icinga node and only connections from a Master/Satellite are possible. This will open the Windows firewall for the chosen Icinga protocol port (default 5665). Certificate generation might require additional steps.';
'Command' = 'Show-IcingaForWindowsInstallerMenuEnterIcingaCAFile';
'Help' = 'Choose this option if the Icinga Agent should not or cannot connect to a parent Icinga node and only connections from a Master/Satellite are possible. This will open the Windows firewall for the chosen Icinga protocol port (default 5665). Certificate generation requires to specify the location of the Icinga ca.crt, which is required to complete the setup process.';
},
@{
'Caption' = 'Connecting from both systems';
Expand All @@ -39,6 +39,22 @@ function Show-IcingaForWindowsInstallerMenuSelectConnection()
-ConfigElement `
-Automated:$Automated `
-Advanced:$Advanced;

# If we choose option 1 "Connecting from parent system", we require to ask the user for the
# location of the ca.crt, as otherwise the api feature will not be enabled. This section will
# ensure we are forwarded to the proper menu later on and certain options are defined for our
# certificate handling
$LastInput = Get-IcingaForWindowsManagementConsoleLastInput;

if ([string]::IsNullOrEmpty($LastInput) -eq $FALSE -and $LastInput -ne '1') {
# Remove the set hostname in case we choose a different option
Add-IcingaForWindowsInstallerConfigEntry -Selection '0' -OverwriteMenu 'Show-IcingaForWindowsInstallerMenuSelectCertificate' -Advanced;
Remove-IcingaForWindowsInstallerConfigEntry -Menu 'Show-IcingaForWindowsInstallerMenuEnterIcingaCAFile';
} elseif ($LastInput -eq '1') {
Add-IcingaForWindowsInstallerConfigEntry -Selection '2' -OverwriteMenu 'Show-IcingaForWindowsInstallerMenuSelectCertificate' -Advanced;
$global:Icinga.InstallWizard.NextCommand = 'Show-IcingaForWindowsInstallerMenuEnterIcingaCAFile';
$global:Icinga.InstallWizard.NextArguments = @{ 'JumpToSummary' = $JumpToSummary; };
}
}

Set-Alias -Name 'IfW-Connection' -Value 'Show-IcingaForWindowsInstallerMenuSelectConnection';