Skip to content

Commit

Permalink
Fixex multiple endpoint handling and IP conversion with Director Self…
Browse files Browse the repository at this point in the history
… Service

Fixes #70
  • Loading branch information
LordHepipud committed Jun 18, 2020
1 parent f667856 commit 0c4121d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ function Convert-IcingaDirectorSelfServiceArguments()
$NetworkDefault += [string]::Format('[{0}]:{1},', $Endpoint, $JsonInput.agent_listen_port);
}
if ([string]::IsNullOrEmpty($NetworkDefault) -eq $FALSE) {
$NetworkDefault = $NetworkDefault.Substring(0, $NetworkDefault.Length - 1);
$NetworkDefault = $NetworkDefault.Substring(0, $NetworkDefault.Length - 1).Split(',');
$DirectorArguments.Add(
'EndpointConnections', $NetworkDefault
);

$EndpointConnections = $NetworkDefault.Split(',');
$EndpointConnections = $NetworkDefault;
$DirectorArguments.Add(
'CAEndpoint', (Get-IPConfigFromString $EndpointConnections[0]).address
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ function Start-IcingaAgentInstallWizard()
if ($EndpointConnections.Count -eq 0) {
$EndpointsConversion = Convert-IcingaEndpointsToIPv4 -NetworkConfig $Endpoints.Split(',');
} else {
$EndpointsConversion = Convert-IcingaEndpointsToIPv4 -NetworkConfig $EndpointConnections.Split(',');
$EndpointsConversion = Convert-IcingaEndpointsToIPv4 -NetworkConfig $EndpointConnections;
}
if ($EndpointsConversion.HasErrors) {
Write-IcingaConsoleWarning -Message 'Not all of your endpoint connection data could be resolved. These endpoints were dropped: {0}' -Objects ([string]::Join(', ', $EndpointsConversion.Unresolved));
Expand Down Expand Up @@ -340,6 +340,12 @@ function Start-IcingaAgentInstallWizard()
}
}
$InstallerArguments += ("-EndpointConnections " + ([string]::Join(',', $EndpointConnections)));
} elseif ($EndpointConnections.Count -ne 0 -And $AcceptConnections -eq 0 -And $ConvertEndpointIPConfig) {
$EndpointsConversion = Convert-IcingaEndpointsToIPv4 -NetworkConfig $EndpointConnections;
if ($EndpointsConversion.HasErrors) {
Write-IcingaConsoleWarning -Message 'Not all of your endpoint connection data could be resolved. These endpoints were dropped: {0}' -Objects ([string]::Join(', ', $EndpointsConversion.Unresolved));
}
$EndpointConnections = $EndpointsConversion.Network;
}

if ([string]::IsNullOrEmpty($ParentZone)) {
Expand Down

0 comments on commit 0c4121d

Please sign in to comment.