Skip to content

Commit 2d02ef1

Browse files
moreamazingnickLordHepipud
authored andcommitted
Adds support for hostname override for old installer
1 parent 86f9e27 commit 2d02ef1

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

doc/100-General/10-Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
4141

4242
* [#40](https://github.com/Icinga/icinga-powershell-framework/issues/40) Adds support to set service recovery for the Icinga Agent and Icinga for Windows service, to restart them in case of a crash or error
4343
* [#485](https://github.com/Icinga/icinga-powershell-framework/issues/485) Adds new style for performance data labels, to use the multi output format, allowing for better filtering and visualisation with InfluxDB and Grafana
44+
* [#502](https://github.com/Icinga/icinga-powershell-framework/pull/502) Adds support for hostname override for old installer function `Start-IcingaAgentInstallWizard` [moreamazingnick]
4445
* [#525](https://github.com/Icinga/icinga-powershell-framework/pull/525) Adds new developer mode for `icinga` command and improved cache handling, to ensure within `-DeveloperMode` and inside a VS Code environment, the framework cache file is never overwritten, while still all functions are loaded and imported.
4546
* [#531](https://github.com/Icinga/icinga-powershell-framework/pull/531) Adds `Test-IcingaStateFile` and `Repair-IcingaStateFile`, which is integrated into `Test-IcingaAgent`, to ensure the Icinga Agent state file is healthy and not corrupt, causing the Icinga Agent to fail on start
4647
* [#534](https://github.com/Icinga/icinga-powershell-framework/pull/534) Improves Icinga and Director configuration generator, by wrapping PowerShell arrays inside `@()` instead of simply writing them comma separated

lib/core/icingaagent/misc/Start-IcingaAgentDirectorWizard.psm1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ function Start-IcingaAgentDirectorWizard()
55
[string]$SelfServiceAPIKey = $null,
66
$OverrideDirectorVars = $null,
77
[bool]$RunInstaller = $FALSE,
8-
[switch]$ForceTemplateKey = $FALSE
8+
[switch]$ForceTemplateKey = $FALSE,
9+
[string]$Hostname = $null
910
);
1011

1112
[hashtable]$DirectorOverrideArgs = @{ }
@@ -64,6 +65,7 @@ function Start-IcingaAgentDirectorWizard()
6465
-DirectorUrl $DirectorUrl `
6566
-SelfServiceAPIKey $TemplateKey `
6667
-OverrideDirectorVars $OverrideDirectorVars `
68+
-Hostname $Hostname `
6769
-ForceTemplateKey;
6870
}
6971
} else {
@@ -74,7 +76,7 @@ function Start-IcingaAgentDirectorWizard()
7476

7577
return Start-IcingaAgentDirectorWizard `
7678
-SelfServiceAPIKey ((Get-IcingaAgentInstallerAnswerInput -Prompt 'Please re-enter your SelfService API Key for the Host-Template in case the key is no longer assigned to your host' -Default 'v' -DefaultInput $SelfServiceAPIKey).answer) `
77-
-OverrideDirectorVars $OverrideDirectorVars;
79+
-OverrideDirectorVars $OverrideDirectorVars -Hostname $Hostname;
7880
}
7981
}
8082

@@ -89,6 +91,10 @@ function Start-IcingaAgentDirectorWizard()
8991
}
9092
}
9193

94+
if($Hostname -ne $null){
95+
$Arguments.Add('Hostname', $Hostname);
96+
}
97+
9298
if ($HostKnown -eq $FALSE) {
9399
while ($TRUE) {
94100
[bool]$RegisterFailed = $FALSE;

lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ function Start-IcingaAgentInstallWizard()
213213
-DirectorUrl $DirectorUrl `
214214
-SelfServiceAPIKey $SelfServiceAPIKey `
215215
-OverrideDirectorVars $OverrideDirectorVars `
216+
-Hostname $Hostname `
216217
-RunInstaller $RunInstaller;
217218

218219
$Result = Set-IcingaWizardArgument -DirectorArgs $DirectorArgs -WizardArg 'DirectorUrl' -Value $DirectorUrl -InstallerArguments $InstallerArguments;

0 commit comments

Comments
 (0)