Fixes missing port argument for save-cert Icinga 2 command

Fixes #63
This commit is contained in:
Lord Hepipud 2020-04-28 14:04:34 +02:00
parent 4f8b51ce78
commit 09d7bf9050

View file

@ -50,15 +50,17 @@ function Install-IcingaAgentCertificates()
# Argument --key for save-cert is deprecated starting with Icinga 2.12.0 # Argument --key for save-cert is deprecated starting with Icinga 2.12.0
if (Compare-IcingaVersions -RequiredVersion '2.12.0') { if (Compare-IcingaVersions -RequiredVersion '2.12.0') {
$arguments = [string]::Format('pki save-cert --trustedcert {0}trusted-parent.crt --host {1}', $arguments = [string]::Format('pki save-cert --trustedcert {0}trusted-parent.crt --host {1} --port {2}',
$CertificateDirectory, $CertificateDirectory,
$Endpoint $Endpoint,
$Port
); );
} else { } else {
$arguments = [string]::Format('pki save-cert --key {0}{1}.key --trustedcert {0}trusted-parent.crt --host {2}', $arguments = [string]::Format('pki save-cert --key {0}{1}.key --trustedcert {0}trusted-parent.crt --host {2} --port {3}',
$CertificateDirectory, $CertificateDirectory,
$Hostname, $Hostname,
$Endpoint $Endpoint,
$Port
); );
} }