From 9fd823c0bc101c98ba1901c0f22d0b1d461d138e Mon Sep 17 00:00:00 2001 From: nilsver Date: Thu, 27 Jun 2024 19:05:04 +0100 Subject: [PATCH 1/4] fix bug mobility pipelines nil --- resources/libraries/get_pipelines.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/libraries/get_pipelines.rb b/resources/libraries/get_pipelines.rb index 62af24be..112453a9 100644 --- a/resources/libraries/get_pipelines.rb +++ b/resources/libraries/get_pipelines.rb @@ -8,6 +8,7 @@ def get_pipelines monitor_sensor_in_proxy_nodes = find_monitor_sensor_in_proxy_nodes() monitor_config = get_monitor_configuration() has_device_sensors = !sensors['device-sensor'].nil? && !sensors['device-sensor'].empty? + location_sensors = %w[ale-sensor mse-sensor flow-sensor arubacentral-sensor] logstash_pipelines.push('rbwindow-pipeline') if main_logstash == node.name logstash_pipelines.push('apstate-pipeline') @@ -19,8 +20,8 @@ def get_pipelines logstash_pipelines.push('sflow-pipeline') unless sensors['flow-sensor'].empty? logstash_pipelines.push('meraki-pipeline') unless sensors['meraki-sensor'].empty? logstash_pipelines.push('monitor-pipeline') unless namespaces.empty? - logstash_pipelines.push('location-pipeline') unless sensors['ale-sensor'].empty? && sensors['mse-sensor'].empty? && sensors['flow-sensor'].empty? && sensors['arubacentral-sensor'].empty? - logstash_pipelines.push('mobility-pipeline') unless sensors['ale-sensor'].empty? && sensors['mse-sensor'].empty? && sensors['flow-sensor'].empty? && sensors['arubacentral-sensor'].empty? + logstash_pipelines.push('location-pipeline') unless location_sensors.any? { |sensor| sensor.nil? || sensor.empty? } + logstash_pipelines.push('mobility-pipeline') unless location_sensors.any? { |sensor| sensor.nil? || sensor.empty? } if (has_device_sensors && monitor_config.include?('thermal')) || !monitor_sensor_in_proxy_nodes.empty? logstash_pipelines.push('redfish-pipeline') end From d3e9e402bba2be1616a812bd12cca333b8c0131a Mon Sep 17 00:00:00 2001 From: nilsver Date: Thu, 27 Jun 2024 22:14:49 +0100 Subject: [PATCH 2/4] fix linter --- resources/libraries/get_pipelines.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/libraries/get_pipelines.rb b/resources/libraries/get_pipelines.rb index 112453a9..e2f61f4d 100644 --- a/resources/libraries/get_pipelines.rb +++ b/resources/libraries/get_pipelines.rb @@ -8,7 +8,7 @@ def get_pipelines monitor_sensor_in_proxy_nodes = find_monitor_sensor_in_proxy_nodes() monitor_config = get_monitor_configuration() has_device_sensors = !sensors['device-sensor'].nil? && !sensors['device-sensor'].empty? - location_sensors = %w[ale-sensor mse-sensor flow-sensor arubacentral-sensor] + location_sensors = %w(ale-sensor mse-sensor flow-sensor arubacentral-sensor) logstash_pipelines.push('rbwindow-pipeline') if main_logstash == node.name logstash_pipelines.push('apstate-pipeline') From 10b3f6e983fd1c033967c83b4f19a20b425aff12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Negr=C3=B3n?= <45871721+manegron@users.noreply.github.com> Date: Fri, 28 Jun 2024 08:54:22 +0100 Subject: [PATCH 3/4] Update get_pipelines.rb --- resources/libraries/get_pipelines.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/resources/libraries/get_pipelines.rb b/resources/libraries/get_pipelines.rb index e2f61f4d..93cad80e 100644 --- a/resources/libraries/get_pipelines.rb +++ b/resources/libraries/get_pipelines.rb @@ -8,7 +8,6 @@ def get_pipelines monitor_sensor_in_proxy_nodes = find_monitor_sensor_in_proxy_nodes() monitor_config = get_monitor_configuration() has_device_sensors = !sensors['device-sensor'].nil? && !sensors['device-sensor'].empty? - location_sensors = %w(ale-sensor mse-sensor flow-sensor arubacentral-sensor) logstash_pipelines.push('rbwindow-pipeline') if main_logstash == node.name logstash_pipelines.push('apstate-pipeline') @@ -20,8 +19,15 @@ def get_pipelines logstash_pipelines.push('sflow-pipeline') unless sensors['flow-sensor'].empty? logstash_pipelines.push('meraki-pipeline') unless sensors['meraki-sensor'].empty? logstash_pipelines.push('monitor-pipeline') unless namespaces.empty? - logstash_pipelines.push('location-pipeline') unless location_sensors.any? { |sensor| sensor.nil? || sensor.empty? } - logstash_pipelines.push('mobility-pipeline') unless location_sensors.any? { |sensor| sensor.nil? || sensor.empty? } + + if (sensors['ale-sensor'] && !sensors['ale-sensor'].empty?) || + (sensors['mse-sensor'] && !sensors['mse-sensor'].empty?) || + (sensors['flow-sensor'] && !sensors['flow-sensor'].empty?) || + (sensors['arubacentral-sensor'] && !sensors['arubacentral-sensor'].empty?) + logstash_pipelines.push('location-pipeline') + logstash_pipelines.push('mobility-pipeline') + end + if (has_device_sensors && monitor_config.include?('thermal')) || !monitor_sensor_in_proxy_nodes.empty? logstash_pipelines.push('redfish-pipeline') end From 7933911bfaa54adc6cd6a80abc8bf2f0f1b59848 Mon Sep 17 00:00:00 2001 From: Miguel Negron Date: Fri, 28 Jun 2024 08:56:34 +0100 Subject: [PATCH 4/4] Fix pipelines check mobility --- CHANGELOG.md | 11 +++++++++++ resources/metadata.rb | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 616ab55c..4ca6894a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ cookbook-rb-manager CHANGELOG =============== +## 2.2.2 + + - Miguel Negrón + - [10b3f6e] Update get_pipelines.rb + - nilsver + - [d3e9e40] fix linter + - [9fd823c] fix bug mobility pipelines nil + - [a97909b] add arubacentral-sensor + - Miguel Negron + - [abe7d76] Release 2.2.1 + ## 2.2.1 - nilsver diff --git a/resources/metadata.rb b/resources/metadata.rb index 3a336e9b..1a580974 100644 --- a/resources/metadata.rb +++ b/resources/metadata.rb @@ -3,7 +3,7 @@ maintainer_email 'git@redborder.com' license 'AGPL-3.0' description 'Installs/Configures redborder manager' -version '2.2.1' +version '2.2.2' depends 'rb-common' depends 'chef-server'