From 292288d42c7d56bfc1459832d89cda7f44524859 Mon Sep 17 00:00:00 2001 From: Miguel Alvarez Date: Mon, 10 Jun 2024 13:53:14 +0100 Subject: [PATCH] Add hosts in node data --- resources/attributes/default.rb | 1 + resources/recipes/configure.rb | 1 + resources/recipes/prepare_system.rb | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/resources/attributes/default.rb b/resources/attributes/default.rb index db1ef8fc..708321ac 100644 --- a/resources/attributes/default.rb +++ b/resources/attributes/default.rb @@ -34,6 +34,7 @@ #webui default["redborder"]["webui"]["port"] = 8001 +default["redborder"]["webui"]["hosts"] = [] #memcached default["redborder"]["memcached"]["elasticache"] = false diff --git a/resources/recipes/configure.rb b/resources/recipes/configure.rb index 924a0f3f..c11965b9 100644 --- a/resources/recipes/configure.rb +++ b/resources/recipes/configure.rb @@ -243,6 +243,7 @@ end webui_config "Configure Nginx WebUI" do + hosts node["redborder"]["webui"]["webui_hosts"] cdomain node["redborder"]["cdomain"] port node["redborder"]["webui"]["port"] action ((manager_services["webui"] and manager_services["nginx"]) ? [:configure_certs, :add_webui_conf_nginx] : :nothing) diff --git a/resources/recipes/prepare_system.rb b/resources/recipes/prepare_system.rb index 0b403d12..6a414bd2 100644 --- a/resources/recipes/prepare_system.rb +++ b/resources/recipes/prepare_system.rb @@ -110,6 +110,11 @@ s3_hosts = node["redborder"]["managers_per_services"]["s3"].map {|z| "#{z}.node:9000"} node.default["redborder"]["s3"]["s3_hosts"] = s3_hosts +# set webui hosts +webui_hosts = node["redborder"]["managers_per_services"]["webui"].map {|z| "#{z}.node"} +node.default["redborder"]["webui"]["webui_hosts"] = webui_hosts + + #set kafka host index if kafka is enabled in this host if node["redborder"]["managers_per_services"]["kafka"].include?(node.name) node.default["redborder"]["kafka"]["host_index"] = node["redborder"]["managers_per_services"]["kafka"].index(node.name)