From 94898ff893cecdb367ff4f85dd8331be5cfe99d6 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Fri, 15 Jan 2021 15:43:46 +0100 Subject: [PATCH] Removes hardcoded global zones --- doc/31-Changelog.md | 2 ++ .../icingaagent/writers/Write-IcingaAgentZonesConfig.psm1 | 7 ------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/doc/31-Changelog.md b/doc/31-Changelog.md index 809cc35..d26b542 100644 --- a/doc/31-Changelog.md +++ b/doc/31-Changelog.md @@ -15,6 +15,8 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic ### 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) [Issue and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/10?closed=1) diff --git a/lib/core/icingaagent/writers/Write-IcingaAgentZonesConfig.psm1 b/lib/core/icingaagent/writers/Write-IcingaAgentZonesConfig.psm1 index bd0ff6f..181ab4e 100644 --- a/lib/core/icingaagent/writers/Write-IcingaAgentZonesConfig.psm1 +++ b/lib/core/icingaagent/writers/Write-IcingaAgentZonesConfig.psm1 @@ -58,13 +58,6 @@ function Write-IcingaAgentZonesConfig() $ZonesConf = [string]::Format('{0} endpoints = [ "{1}" ];{2}', $ZonesConf, $Hostname, "`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) { $ZonesConf = [string]::Format('{0}object Zone "{1}" {2}{3}', $ZonesConf, $zone, '{', "`r`n"); $ZonesConf = [string]::Format('{0} global = true;{1}', $ZonesConf, "`r`n");