mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Fixes duplicate connection question
This commit is contained in:
parent
32d3f7d77f
commit
e114c37b95
1 changed files with 14 additions and 24 deletions
|
|
@ -219,16 +219,6 @@ function Start-IcingaAgentInstallWizard()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($null -eq $AcceptConnections) {
|
|
||||||
if ((Get-IcingaAgentInstallerAnswerInput -Prompt 'Will this Agent connect to its parent endpoint(s)?' -Default 'y').result -eq 1) {
|
|
||||||
$InstallerArguments += "-AcceptConnections 1";
|
|
||||||
$AcceptConnections = 1;
|
|
||||||
} else {
|
|
||||||
$InstallerArguments += "-AcceptConnections 0";
|
|
||||||
$AcceptConnections = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($Endpoints.Count -eq 0) {
|
if ($Endpoints.Count -eq 0) {
|
||||||
$ArrayString = (Get-IcingaAgentInstallerAnswerInput -Prompt 'Please specify all endpoints this Agent will report to (separated by ",")' -Default 'v').answer;
|
$ArrayString = (Get-IcingaAgentInstallerAnswerInput -Prompt 'Please specify all endpoints this Agent will report to (separated by ",")' -Default 'v').answer;
|
||||||
$Endpoints = ($ArrayString.Replace(' ', '')).Split(',');
|
$Endpoints = ($ArrayString.Replace(' ', '')).Split(',');
|
||||||
|
|
@ -245,6 +235,20 @@ function Start-IcingaAgentInstallWizard()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[bool]$CanConnectToParent = $FALSE;
|
||||||
|
|
||||||
|
if ($null -eq $AcceptConnections) {
|
||||||
|
if ((Get-IcingaAgentInstallerAnswerInput -Prompt 'Is this Agent able to connect to its parent node for certificate generation and general communication?' -Default 'y').result -eq 1) {
|
||||||
|
$CanConnectToParent = $TRUE;
|
||||||
|
$InstallerArguments += ("-AcceptConnections 1");
|
||||||
|
} else {
|
||||||
|
$InstallerArguments += ("-AcceptConnections 0");
|
||||||
|
}
|
||||||
|
} elseif ($AcceptConnections) {
|
||||||
|
$CanConnectToParent = $TRUE;
|
||||||
|
$InstallerArguments += ("-AcceptConnections 1");
|
||||||
|
}
|
||||||
|
|
||||||
if ($AcceptConnections -eq 0) {
|
if ($AcceptConnections -eq 0) {
|
||||||
if ($null -eq $AddFirewallRule) {
|
if ($null -eq $AddFirewallRule) {
|
||||||
if ((Get-IcingaAgentInstallerAnswerInput -Prompt ([string]::Format('Do you want to open the Windows Firewall for incoming traffic on Port "{0}"?', $CAPort)) -Default 'y').result -eq 1) {
|
if ((Get-IcingaAgentInstallerAnswerInput -Prompt ([string]::Format('Do you want to open the Windows Firewall for incoming traffic on Port "{0}"?', $CAPort)) -Default 'y').result -eq 1) {
|
||||||
|
|
@ -317,20 +321,6 @@ function Start-IcingaAgentInstallWizard()
|
||||||
$GlobalZoneConfig += $GlobalZones;
|
$GlobalZoneConfig += $GlobalZones;
|
||||||
}
|
}
|
||||||
|
|
||||||
[bool]$CanConnectToParent = $FALSE;
|
|
||||||
|
|
||||||
if ($null -eq $AcceptConnections) {
|
|
||||||
if ((Get-IcingaAgentInstallerAnswerInput -Prompt 'Is this Agent able to connect to its parent node for certificate generation?' -Default 'y').result -eq 1) {
|
|
||||||
$CanConnectToParent = $TRUE;
|
|
||||||
$InstallerArguments += ("-AcceptConnections 1");
|
|
||||||
} else {
|
|
||||||
$InstallerArguments += ("-AcceptConnections 0");
|
|
||||||
}
|
|
||||||
} elseif ($AcceptConnections) {
|
|
||||||
$CanConnectToParent = $TRUE;
|
|
||||||
$InstallerArguments += ("-AcceptConnections 1");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($CanConnectToParent) {
|
if ($CanConnectToParent) {
|
||||||
if ([string]::IsNullOrEmpty($CAEndpoint)) {
|
if ([string]::IsNullOrEmpty($CAEndpoint)) {
|
||||||
$CAEndpoint = (Get-IcingaAgentInstallerAnswerInput -Prompt 'Please enter the FQDN for either ONE of your Icinga parent node/nodes or your Icinga 2 CA master' -Default 'v' -DefaultInput (Get-IPConfigFromString $EndpointConnections[0]).address).answer;
|
$CAEndpoint = (Get-IcingaAgentInstallerAnswerInput -Prompt 'Please enter the FQDN for either ONE of your Icinga parent node/nodes or your Icinga 2 CA master' -Default 'v' -DefaultInput (Get-IPConfigFromString $EndpointConnections[0]).address).answer;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue