From d97ab55a9aef677d94475eee9692fa3f7e722384 Mon Sep 17 00:00:00 2001 From: David Vanhoucke Date: Wed, 17 Jan 2024 10:52:13 +0000 Subject: [PATCH 1/2] adding rb-arubacentral --- resources/attributes/default.rb | 3 +++ resources/libraries/get_sensors_all_info.rb | 2 +- resources/metadata.rb | 1 + resources/recipes/configure.rb | 7 +++++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/resources/attributes/default.rb b/resources/attributes/default.rb index 29083853..5e8ab52d 100644 --- a/resources/attributes/default.rb +++ b/resources/attributes/default.rb @@ -85,6 +85,7 @@ default["redborder"]["memory_services"]["snmp"] = {"count" => 5, "memory" => 0, "max_limit" => 10000 } default["redborder"]["memory_services"]["redborder-monitor"] = {"count" => 5, "memory" => 0, "max_limit" => 20000 } default["redborder"]["memory_services"]["rb-logstatter"] = {"count" => 5, "memory" => 0, "max_limit" => 20000 } +default["redborder"]["memory_services"]["rb-arubacentral"] = {"count" => 5, "memory" => 0, "max_limit" => 20000 } default["redborder"]["memory_services"]["webui"] = {"count" => 40, "memory" => 0 } default["redborder"]["memory_services"]["f2k"] = { "count" => 40, "memory" => 0 } default["redborder"]["memory_services"]["redborder-nmsp"] = {"count" => 10, "memory" => 0 } @@ -148,6 +149,7 @@ default["redborder"]["services"]["redborder-cep"] = false default["redborder"]["services"]["rb-aioutliers"] = false default["redborder"]["services"]["rb-logstatter"] = true +default["redborder"]["services"]["rb-arubacentral"] = false default["redborder"]["services"]["memcached"] = true default["redborder"]["services"]["rb-monitor"] = false default["redborder"]["services"]["secor"] = false @@ -186,6 +188,7 @@ default["redborder"]["systemdservices"]["redborder-cep"] = ["redborder-cep"] default["redborder"]["systemdservices"]["rb-aioutliers"] = ["rb-aioutliers"] default["redborder"]["systemdservices"]["rb-logstatter"] = ["rb-logstatter"] +default["redborder"]["systemdservices"]["rb-arubacentral"] = ["rb-arubacentral"] default["redborder"]["systemdservices"]["memcached"] = ["memcached"] default["redborder"]["systemdservices"]["s3"] = ["minio"] default["redborder"]["systemdservices"]["mongodb"] = ["mongod"] diff --git a/resources/libraries/get_sensors_all_info.rb b/resources/libraries/get_sensors_all_info.rb index d420fa84..a4e1bede 100644 --- a/resources/libraries/get_sensors_all_info.rb +++ b/resources/libraries/get_sensors_all_info.rb @@ -2,7 +2,7 @@ module Rb_manager module Helpers def get_sensors_all_info() sensors_info = {} - sensor_types = ["ips-sensor","ipsv2-sensor","ipscp-sensor","ipsg-sensor","vault-sensor","flow-sensor","mse-sensor","meraki-sensor","cisco-cloudproxy","proxy-sensor","scanner-sensor","mse-sensor","meraki-sensor","ale-sensor","cep-sensor","device-sensor"] + sensor_types = ["ips-sensor","ipsv2-sensor","ipscp-sensor","ipsg-sensor","vault-sensor","flow-sensor","arubacentral-sensor","mse-sensor","meraki-sensor","cisco-cloudproxy","proxy-sensor","scanner-sensor","mse-sensor","meraki-sensor","ale-sensor","cep-sensor","device-sensor"] sensor_types.each do |s_type| sensors = search(:node, "role:#{s_type} AND -redborder_parent_id:*?").sort #get sensor where parent_id is nil diff --git a/resources/metadata.rb b/resources/metadata.rb index 02613416..f93df4a6 100644 --- a/resources/metadata.rb +++ b/resources/metadata.rb @@ -41,3 +41,4 @@ #depends 'rbaioutliers' depends 'rbcgroup' depends 'rblogstatter' +depends 'rb-arubacentral' diff --git a/resources/recipes/configure.rb b/resources/recipes/configure.rb index ebd271e9..8f1cc23c 100644 --- a/resources/recipes/configure.rb +++ b/resources/recipes/configure.rb @@ -319,6 +319,13 @@ action (node["redborder"]["services"]["rb-logstatter"] ? :add : :remove) end +rb_arubacentral_config "Configure rb-arubacentral" do + arubacentral_nodes node["redborder"]["sensors_info_all"]["arubacentral-sensor"] + flow_nodes node["redborder"]["sensors_info_all"]["flow-sensor"] + kafka_brokers node["redborder"]["managers_per_services"]["kafka"] + action (node["redborder"]["services"]["rb-arubacentral"] ? :add : :remove) +end + #freeradius_config "Configure radiusd" do # flow_nodes node["redborder"]["sensors_info_all"]["flow-sensor"] # action (node["redborder"]["services"]["radiusd"] ? [:config_common, :config_manager, :register] : [:remove, :deregister]) From 143ce35cc5f05839c76975398914c933001fb7ed Mon Sep 17 00:00:00 2001 From: David Vanhoucke Date: Wed, 17 Jan 2024 15:55:55 +0000 Subject: [PATCH 2/2] use default kafka.service --- resources/recipes/configure.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/recipes/configure.rb b/resources/recipes/configure.rb index 8f1cc23c..eeaa895f 100644 --- a/resources/recipes/configure.rb +++ b/resources/recipes/configure.rb @@ -322,7 +322,6 @@ rb_arubacentral_config "Configure rb-arubacentral" do arubacentral_nodes node["redborder"]["sensors_info_all"]["arubacentral-sensor"] flow_nodes node["redborder"]["sensors_info_all"]["flow-sensor"] - kafka_brokers node["redborder"]["managers_per_services"]["kafka"] action (node["redborder"]["services"]["rb-arubacentral"] ? :add : :remove) end