mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Fixes parent connection not asking for ca.crt
This commit is contained in:
parent
e17c416ed3
commit
1c88fe2a09
5 changed files with 43 additions and 3 deletions
|
|
@ -14,6 +14,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
||||||
### Bugfixes
|
### 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
|
* [#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
|
### Enhancements
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,11 @@ function Add-IcingaForWindowsInstallationAdvancedEntries()
|
||||||
|
|
||||||
Show-IcingaForWindowsInstallationMenuEnterIcingaPort -Automated -Advanced;
|
Show-IcingaForWindowsInstallationMenuEnterIcingaPort -Automated -Advanced;
|
||||||
Show-IcingaForWindowsInstallerMenuSelectOpenWindowsFirewall -DefaultInput $OpenFirewall -Automated -Advanced;
|
Show-IcingaForWindowsInstallerMenuSelectOpenWindowsFirewall -DefaultInput $OpenFirewall -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-IcingaForWindowsInstallerMenuSelectCertificate -Automated -Advanced;
|
||||||
|
}
|
||||||
Show-IcingaForWindowsInstallerMenuSelectForceCertificateGeneration -Automated -Advanced;
|
Show-IcingaForWindowsInstallerMenuSelectForceCertificateGeneration -Automated -Advanced;
|
||||||
Show-IcingaForWindowsInstallerMenuSelectGlobalZones -Automated -Advanced;
|
Show-IcingaForWindowsInstallerMenuSelectGlobalZones -Automated -Advanced;
|
||||||
Show-IcingaForWindowsInstallationMenuEnterCustomGlobalZones -Automated -Advanced;
|
Show-IcingaForWindowsInstallationMenuEnterCustomGlobalZones -Automated -Advanced;
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,14 @@ function Show-IcingaForWindowsInstallerMenuEnterIcingaCAFile()
|
||||||
-ConfigElement `
|
-ConfigElement `
|
||||||
-Automated:$Automated `
|
-Automated:$Automated `
|
||||||
-Advanced:$Advanced;
|
-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';
|
Set-Alias -Name 'IfW-CAFile' -Value 'Show-IcingaForWindowsInstallerMenuEnterIcingaCAFile';
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,17 @@ function Show-IcingaForWindowsInstallerMenuSelectCertificate()
|
||||||
break;
|
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';
|
Set-Alias -Name 'IfW-Certificate' -Value 'Show-IcingaForWindowsInstallerMenuSelectCertificate';
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ function Show-IcingaForWindowsInstallerMenuSelectConnection()
|
||||||
},
|
},
|
||||||
@{
|
@{
|
||||||
'Caption' = 'Connecting from parent system';
|
'Caption' = 'Connecting from parent system';
|
||||||
'Command' = 'Show-IcingaForWindowsInstallerMenuSelectHostname';
|
'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 might require additional steps.';
|
'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';
|
'Caption' = 'Connecting from both systems';
|
||||||
|
|
@ -39,6 +39,22 @@ function Show-IcingaForWindowsInstallerMenuSelectConnection()
|
||||||
-ConfigElement `
|
-ConfigElement `
|
||||||
-Automated:$Automated `
|
-Automated:$Automated `
|
||||||
-Advanced:$Advanced;
|
-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';
|
Set-Alias -Name 'IfW-Connection' -Value 'Show-IcingaForWindowsInstallerMenuSelectConnection';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue