Removes hardcoded global zones

This commit is contained in:
Lord Hepipud 2021-01-15 15:43:46 +01:00
parent 80f31cc1e6
commit 94898ff893
2 changed files with 2 additions and 7 deletions

View file

@ -15,6 +15,8 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
### Bugfixes ### Bugfixes
* [#188](https://github.com/Icinga/icinga-powershell-framework/pull/188) Removes hardcoded zones `director-global` and `global-zones` which were always set regardless of user specification. This fix will ensure the user has the option to add or not add these zones
## 1.3.0 (2020-12-01) ## 1.3.0 (2020-12-01)
[Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/10?closed=1) [Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/10?closed=1)

View file

@ -58,13 +58,6 @@ function Write-IcingaAgentZonesConfig()
$ZonesConf = [string]::Format('{0} endpoints = [ "{1}" ];{2}', $ZonesConf, $Hostname, "`r`n"); $ZonesConf = [string]::Format('{0} endpoints = [ "{1}" ];{2}', $ZonesConf, $Hostname, "`r`n");
$ZonesConf = [string]::Format('{0}{1}{2}{2}', $ZonesConf, '}', "`r`n"); $ZonesConf = [string]::Format('{0}{1}{2}{2}', $ZonesConf, '}', "`r`n");
if ($GlobalZones.Contains('director-global') -eq $FALSE) {
$GlobalZones += 'director-global';
}
if ($GlobalZones.Contains('global-templates') -eq $FALSE) {
$GlobalZones += 'global-templates';
}
foreach ($zone in $GlobalZones) { foreach ($zone in $GlobalZones) {
$ZonesConf = [string]::Format('{0}object Zone "{1}" {2}{3}', $ZonesConf, $zone, '{', "`r`n"); $ZonesConf = [string]::Format('{0}object Zone "{1}" {2}{3}', $ZonesConf, $zone, '{', "`r`n");
$ZonesConf = [string]::Format('{0} global = true;{1}', $ZonesConf, "`r`n"); $ZonesConf = [string]::Format('{0} global = true;{1}', $ZonesConf, "`r`n");