Skip to content

Commit

Permalink
excluded mem services is a new attribute of data structure set
Browse files Browse the repository at this point in the history
  • Loading branch information
ljblancoredborder committed May 7, 2024
1 parent 04f74cf commit 8467504
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions resources/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'set' # In case of reapeating, set will handle. Array won't
#Default attributes

#general
Expand Down Expand Up @@ -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"] = {}
Expand Down
2 changes: 1 addition & 1 deletion resources/recipes/prepare_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8467504

Please sign in to comment.