Fixes config writer publishing invalid Icinga plain config

This commit is contained in:
LordHepipud 2023-08-07 20:02:58 +02:00
parent e2bd207a69
commit a29d66dbd9
2 changed files with 13 additions and 1 deletions

View file

@ -7,6 +7,14 @@ documentation before upgrading to a new release.
Released closed milestones can be found on [GitHub](https://github.com/Icinga/icinga-powershell-framework/milestones?state=closed).
## 1.11.1 (tbd)
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/29)
### Bugfixes
* [#659](https://github.com/Icinga/icinga-powershell-framework/pull/659) Fixes configuration writer which publishes invalid Icinga plain configuration files
## 1.11.0 (2023-08-01)
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/26)

View file

@ -666,7 +666,11 @@ function Write-IcingaPlainConfigurationFiles()
$AddNewLine = $FALSE;
}
[string]$Value = $CheckCommand.vars[$var];
$IcingaConfig += [string]::Format(' vars.{0} = {1}{2}', $var, $Value.ToLower(), (New-IcingaNewLine));
if ($CheckCommand.vars[$var] -Is [bool]) {
$IcingaConfig += [string]::Format(' vars.{0} = {1}{2}', $var, $Value.ToLower(), (New-IcingaNewLine));
} else {
$IcingaConfig += [string]::Format(' vars.{0} = "{1}"{2}', $var, $Value.ToLower(), (New-IcingaNewLine));
}
}
}
} else {