Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/31-Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
* [#327](https://github.com/Icinga/icinga-powershell-framework/pull/327) Fixes possible exception on first import run for certain systems
* [#328](https://github.com/Icinga/icinga-powershell-framework/pull/328) Fixes installer while using installation files or the installation command, which did not overwrite default values with custom values
* [#330](https://github.com/Icinga/icinga-powershell-framework/pull/330) Fixes `Remove-ItemSecure` which was not using all args and might fail on empty path entries
* [#331](https://github.com/Icinga/icinga-powershell-framework/pull/331) Fixes Icinga Director Self-Service installation over Icinga Management Console

### Enhancements

Expand Down
3 changes: 2 additions & 1 deletion lib/core/installer/Start-IcingaForWindowsInstallation.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function Start-IcingaForWindowsInstallation()
$IcingaZone = Get-IcingaForWindowsInstallerValuesFromStep -InstallerStep 'Show-IcingaForWindowsInstallerMenuEnterIcingaParentZone';
$IcingaEndpoints = Get-IcingaForWindowsInstallerValuesFromStep -InstallerStep 'Show-IcingaForWindowsInstallerMenuEnterIcingaParentNodes';
$IcingaPort = Get-IcingaForWindowsInstallerValuesFromStep -InstallerStep 'Show-IcingaForWindowsInstallationMenuEnterIcingaPort';
$IcingaCAServer = Get-IcingaForWindowsInstallerValuesFromStep -InstallerStep 'Show-IcingaForWindowsInstallationMenuEnterIcingaCAServer';

# Repository
$IcingaStableRepo = Get-IcingaForWindowsInstallerValuesFromStep -InstallerStep 'Show-IcingaForWindowsInstallationMenuStableRepository';
Expand Down Expand Up @@ -172,7 +173,7 @@ function Start-IcingaForWindowsInstallation()
Write-IcingaAgentApiConfig -Port $IcingaPort;
}

if ((Install-IcingaAgentCertificates -Hostname $Hostname -Endpoint $IcingaParentAddresses[0] -Port $IcingaPort -CACert $CertificateCAFile -Ticket $CertificateTicket) -eq $FALSE) {
if ((Install-IcingaAgentCertificates -Hostname $Hostname -Endpoint $IcingaCAServer -Port $IcingaPort -CACert $CertificateCAFile -Ticket $CertificateTicket) -eq $FALSE) {
Disable-IcingaAgentFeature 'api';
Write-IcingaConsoleWarning `
-Message '{0}{1}{2}{3}{4}' `
Expand Down
1 change: 1 addition & 0 deletions lib/core/installer/menu/installation/AdvancedEntries.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function Add-IcingaForWindowsInstallationAdvancedEntries()
Show-IcingaForWindowsInstallationMenuEnterWindowsServiceDirectory -Automated -Advanced;
Show-IcingaForWindowsInstallationMenuStableRepository -Automated -Advanced;
Show-IcingaForWindowsInstallerMenuSelectInstallJEAProfile -Automated -Advanced;
Show-IcingaForWindowsInstallationMenuEnterIcingaCAServer -Automated -Advanced;

Enable-IcingaFrameworkConsoleOutput;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function Resolve-IcingaForWindowsManagementConsoleInstallationDirectorTemplate()

$DirectorUrl = Get-IcingaForWindowsInstallerValuesFromStep -InstallerStep 'Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorUrl';
$SelfServiceKey = Get-IcingaForWindowsInstallerValuesFromStep -InstallerStep 'Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorSelfServiceKey';
$UsedEnteredKey = $SelfServiceKey;

# Once we run this menu, we require to reset everything to have a proper state
if ($Register -eq $FALSE) {
Expand Down Expand Up @@ -46,6 +47,7 @@ function Resolve-IcingaForWindowsManagementConsoleInstallationDirectorTemplate()

try {
$SelfServiceKey = Register-IcingaDirectorSelfServiceHost -DirectorUrl $DirectorUrl -ApiKey $SelfServiceKey -Hostname $Hostname;
$UsedEnteredKey = $SelfServiceKey;
} catch {
Write-IcingaConsoleNotice 'Host seems already to be registered within Icinga Director. Trying local Api key if present'
$SelfServiceKey = Get-IcingaPowerShellConfig -Path 'IcingaDirector.SelfService.ApiKey';
Expand All @@ -54,7 +56,7 @@ function Resolve-IcingaForWindowsManagementConsoleInstallationDirectorTemplate()
Write-IcingaConsoleNotice 'No local Api key was found and using your provided template key failed. Please ensure the host is not already registered and drop the set Self-Service key within the Icinga Director for this host.'
}
}
Add-IcingaForWindowsInstallerConfigEntry -Selection 'c' -Values $SelfServiceKey -OverwriteValues -OverwriteMenu 'Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorSelfServiceKey';
Add-IcingaForWindowsInstallerConfigEntry -Selection 'c' -Values $UsedEnteredKey -OverwriteValues -OverwriteMenu 'Show-IcingaForWindowsManagementConsoleInstallationEnterDirectorSelfServiceKey';
}

try {
Expand Down Expand Up @@ -184,6 +186,8 @@ function Resolve-IcingaForWindowsManagementConsoleInstallationDirectorTemplate()
Show-IcingaForWindowsInstallerMenuEnterIcingaParentZone -Value $ParentZone -Automated;
}

Show-IcingaForWindowsInstallationMenuEnterIcingaCAServer -Automated -Value $MasterAddress;

Show-IcingaForWindowsManagementConsoleInstallationDirectorRegisterHost -Automated;

Enable-IcingaFrameworkConsoleOutput;
Expand Down
43 changes: 43 additions & 0 deletions lib/core/installer/menu/installation/icinga/IcingaCAServer.psm1
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
function Show-IcingaForWindowsInstallationMenuEnterIcingaCAServer()
{
param (
[array]$Value = @(),
[string]$DefaultInput = 'c',
[switch]$JumpToSummary = $FALSE,
[switch]$Automated = $FALSE,
[switch]$Advanced = $FALSE
);

if ($null -eq $Value -or $Value.Count -eq 0) {
$IcingaEndpoints = Get-IcingaForWindowsInstallerValuesFromStep -InstallerStep 'Show-IcingaForWindowsInstallerMenuEnterIcingaParentNodes';

foreach ($endpoint in $IcingaEndpoints) {
$EndpointAddress = Get-IcingaForWindowsInstallerValuesFromStep -InstallerStep 'Show-IcingaForWindowsInstallerMenuEnterIcingaParentAddresses' -Parent $endpoint;

if ($null -ne $EndpointAddress -And [string]::IsNullOrEmpty($EndpointAddress) -eq $FALSE) {
$Value += $EndpointAddress;
break;
}
}
}

Show-IcingaForWindowsInstallerMenu `
-Header 'Please enter your Icinga CA server:' `
-Entries @(
@{
'Command' = 'Show-IcingaForWindowsInstallerConfigurationSummary';
'Help' = 'This is the Icinga endpoint to connect to for signing your certificates. This can be a satellite, as requests will be forwarded to your CA server.';
}
) `
-DefaultIndex $DefaultInput `
-AddConfig `
-ConfigLimit 1 `
-DefaultValues @( $Value ) `
-MandatoryValue `
-JumpToSummary:$JumpToSummary `
-ConfigElement `
-Automated:$Automated `
-Advanced:$Advanced;
}

Set-Alias -Name 'IfW-CAServer' -Value 'Show-IcingaForWindowsInstallationMenuEnterIcingaCAServer';