Removes hardcoded global zones

This commit is contained in:
Lord Hepipud 2021-01-15 15:43:46 +01:00
parent 18f5ad8005
commit 20c28b25e0
2 changed files with 10 additions and 7 deletions

View file

@ -7,6 +7,16 @@ 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). Released closed milestones can be found on [GitHub](https://github.com/Icinga/icinga-powershell-framework/milestones?state=closed).
## 1.3.1 (2021-02-04)
[Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/12?closed=1)
### Enhancements
### 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");