mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
parent
aa8d712152
commit
0ba6fd35f4
9 changed files with 14 additions and 0 deletions
|
|
@ -37,6 +37,7 @@ function Get-IcingaDirectorSelfServiceConfig()
|
||||||
throw 'Please enter either a template or your host key. If this message persists, ensure your host is not having a template key assigned already. If so, you can try dropping it within the Icinga Director.';
|
throw 'Please enter either a template or your host key. If this message persists, ensure your host is not having a template key assigned already. If so, you can try dropping it within the Icinga Director.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Set-IcingaTLSVersion;
|
||||||
$ProgressPreference = "SilentlyContinue";
|
$ProgressPreference = "SilentlyContinue";
|
||||||
|
|
||||||
$EndpointUrl = Join-WebPath -Path $DirectorUrl -ChildPath ([string]::Format('/self-service/powershell-parameters?key={0}', $ApiKey));
|
$EndpointUrl = Join-WebPath -Path $DirectorUrl -ChildPath ([string]::Format('/self-service/powershell-parameters?key={0}', $ApiKey));
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@ function Get-IcingaDirectorSelfServiceTicket()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Set-IcingaTLSVersion;
|
||||||
|
|
||||||
[string]$url = Join-WebPath -Path $DirectorUrl -ChildPath ([string]::Format('/self-service/ticket?key={0}', $ApiKey));
|
[string]$url = Join-WebPath -Path $DirectorUrl -ChildPath ([string]::Format('/self-service/ticket?key={0}', $ApiKey));
|
||||||
|
|
||||||
$response = Invoke-WebRequest -Uri $url -UseBasicParsing -Headers @{ 'accept' = 'application/json'; 'X-Director-Accept' = 'application/json' } -Method 'POST';
|
$response = Invoke-WebRequest -Uri $url -UseBasicParsing -Headers @{ 'accept' = 'application/json'; 'X-Director-Accept' = 'application/json' } -Method 'POST';
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ function Register-IcingaDirectorSelfServiceHost()
|
||||||
throw 'Please enter the API key of the template you wish to use';
|
throw 'Please enter the API key of the template you wish to use';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Set-IcingaTLSVersion;
|
||||||
$ProgressPreference = "SilentlyContinue";
|
$ProgressPreference = "SilentlyContinue";
|
||||||
$DirectorConfigJson = $null;
|
$DirectorConfigJson = $null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ function Get-IcingaFrameworkServiceBinary()
|
||||||
[string]$ServiceDirectory
|
[string]$ServiceDirectory
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Set-IcingaTLSVersion;
|
||||||
$ProgressPreference = "SilentlyContinue";
|
$ProgressPreference = "SilentlyContinue";
|
||||||
|
|
||||||
if ([string]::IsNullOrEmpty($FrameworkServiceUrl)) {
|
if ([string]::IsNullOrEmpty($FrameworkServiceUrl)) {
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ function Get-IcingaPowerShellModuleArchive()
|
||||||
[bool]$DryRun = $FALSE
|
[bool]$DryRun = $FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Set-IcingaTLSVersion;
|
||||||
$ProgressPreference = "SilentlyContinue";
|
$ProgressPreference = "SilentlyContinue";
|
||||||
$Tag = 'master';
|
$Tag = 'master';
|
||||||
[bool]$SkipRepo = $FALSE;
|
[bool]$SkipRepo = $FALSE;
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@ function Install-IcingaFrameworkComponent()
|
||||||
throw 'Please specify a component name to install from a GitHub/Local space';
|
throw 'Please specify a component name to install from a GitHub/Local space';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Set-IcingaTLSVersion;
|
||||||
|
|
||||||
$TextInfo = (Get-Culture).TextInfo;
|
$TextInfo = (Get-Culture).TextInfo;
|
||||||
$ComponentName = $TextInfo.ToTitleCase($Name);
|
$ComponentName = $TextInfo.ToTitleCase($Name);
|
||||||
$RepositoryName = [string]::Format('icinga-powershell-{0}', $Name);
|
$RepositoryName = [string]::Format('icinga-powershell-{0}', $Name);
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ function Get-IcingaAgentMSIPackage()
|
||||||
throw 'Please specify a valid download URL, like "https://packages.icinga.com/windows/"';
|
throw 'Please specify a valid download URL, like "https://packages.icinga.com/windows/"';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Set-IcingaTLSVersion;
|
||||||
# Disable the progress bar for the WebRequest
|
# Disable the progress bar for the WebRequest
|
||||||
$ProgressPreference = "SilentlyContinue";
|
$ProgressPreference = "SilentlyContinue";
|
||||||
$Architecture = Get-IcingaAgentArchitecture;
|
$Architecture = Get-IcingaAgentArchitecture;
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,7 @@ function Copy-IcingaAgentCACertificate()
|
||||||
Copy-Item -Path $CAPath -Destination (Join-Path -Path $Desination -ChildPath 'ca.crt') | Out-Null;
|
Copy-Item -Path $CAPath -Destination (Join-Path -Path $Desination -ChildPath 'ca.crt') | Out-Null;
|
||||||
Write-IcingaConsoleNotice ([string]::Format('Copied ca.crt from "{0}" to "{1}', $CAPath, $Desination));
|
Write-IcingaConsoleNotice ([string]::Format('Copied ca.crt from "{0}" to "{1}', $CAPath, $Desination));
|
||||||
} else {
|
} else {
|
||||||
|
Set-IcingaTLSVersion;
|
||||||
# It could also be a web ressource
|
# It could also be a web ressource
|
||||||
try {
|
try {
|
||||||
$response = Invoke-WebRequest $CAPath -UseBasicParsing;
|
$response = Invoke-WebRequest $CAPath -UseBasicParsing;
|
||||||
|
|
|
||||||
4
lib/web/Set-IcingaTLSVersion.psm1
Normal file
4
lib/web/Set-IcingaTLSVersion.psm1
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
function Set-IcingaTLSVersion()
|
||||||
|
{
|
||||||
|
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11";
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue