From 84675041d44921b6fbac27fc09ab92690044cc3a Mon Sep 17 00:00:00 2001 From: Luis Blanco Date: Tue, 7 May 2024 12:05:46 +0100 Subject: [PATCH] excluded mem services is a new attribute of data structure set --- resources/attributes/default.rb | 3 +++ resources/recipes/prepare_system.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/attributes/default.rb b/resources/attributes/default.rb index 6477e968..0d246978 100644 --- a/resources/attributes/default.rb +++ b/resources/attributes/default.rb @@ -1,3 +1,4 @@ +require 'set' # In case of reapeating, set will handle. Array won't #Default attributes #general @@ -92,6 +93,8 @@ default["redborder"]["memory_services"]["n2klocd"] = {"count" => 10, "memory" => 0 } default["redborder"]["memory_services"]["redborder-cep"] = {"count" => 10, "memory" => 0 } default["redborder"]["memory_services"]["rb-aioutliers"] = {"count" => 10, "memory" => 0 } +# excluded mem services +default['redborder']['excluded_memservices'] = Set.new(['chef-client']) # Don't assign memory to chef because the service will get handled # default attributes for managers_info, it would be rewriten with the cluster config default["redborder"]["cluster_info"] = {} diff --git a/resources/recipes/prepare_system.rb b/resources/recipes/prepare_system.rb index f798934a..6dc6977d 100644 --- a/resources/recipes/prepare_system.rb +++ b/resources/recipes/prepare_system.rb @@ -130,7 +130,7 @@ #getting total system memory less 10% reserved by system sysmem_total = (node["memory"]["total"].to_i * 0.90).to_i #node attributes related with memory are changed inside the function to have simplicity using recursivity -memory_services(sysmem_total, ['chef-client']) # Don't assign memory to chef because the service will get handled +memory_services(sysmem_total, node['redborder']['excluded_memservices']) #License