From 2686d8944dffc25cdbc8c7e9cbf7734996710a5d Mon Sep 17 00:00:00 2001 From: Miguel Alvarez Date: Wed, 12 Jun 2024 16:35:51 +0100 Subject: [PATCH] Fix lint issues --- resources/attributes/default.rb | 2 +- resources/recipes/configure.rb | 24 ++++++++++++------------ resources/recipes/prepare_system.rb | 10 +++++----- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/resources/attributes/default.rb b/resources/attributes/default.rb index eb2ff023..8354d4e6 100644 --- a/resources/attributes/default.rb +++ b/resources/attributes/default.rb @@ -6,7 +6,7 @@ # s3 default['redborder']['uploaded_s3'] = false -default["redborder"]["s3"]["s3_hosts"] = [] +default['redborder']['s3']['s3_hosts'] = [] # chef-client default['chef-client']['interval'] = 300 diff --git a/resources/recipes/configure.rb b/resources/recipes/configure.rb index e5499163..a7aaa90e 100644 --- a/resources/recipes/configure.rb +++ b/resources/recipes/configure.rb @@ -517,26 +517,26 @@ end # Allow only s3 onpremise nodes for now.. -minio_config "Configure S3 (minio)" do - ipaddress node["ipaddress_sync"] - access_key_id s3_secrets["s3_access_key_id"] - secret_key_id s3_secrets["s3_secret_key_id"] - action ((manager_services["s3"] and external_services["s3"] == "onpremise") ? [:add, :register] : [:remove, :deregister]) +minio_config 'Configure S3 (minio)' do + ipaddress node['ipaddress_sync'] + access_key_id s3_secrets['s3_access_key_id'] + secret_key_id s3_secrets['s3_secret_key_id'] + action((manager_services['s3'] && (external_services['s3'] == 'onpremise')) ? [:add, :register] : [:remove, :deregister]) end # First configure the cert for the service before configuring nginx -if manager_services["s3"] - nginx_config "Configure S3 certs" do - service_name "s3" - cdomain node["redborder"]["cdomain"] +if manager_services['s3'] + nginx_config 'Configure S3 certs' do + service_name 's3' + cdomain node['redborder']['cdomain'] action :configure_certs end end # Configure Nginx s3 onpremise nodes for now.. -minio_config "Configure Nginx S3 (minio)" do - s3_hosts node["redborder"]["s3"]["s3_hosts"] - action ((manager_services["s3"] and external_services["s3"] == "onpremise") ? [:add_s3_conf_nginx] : :nothing) +minio_config 'Configure Nginx S3 (minio)' do + s3_hosts node['redborder']['s3']['s3_hosts'] + action((manager_services['s3'] && (external_services['s3'] == 'onpremise')) ? [:add_s3_conf_nginx] : :nothing) end begin diff --git a/resources/recipes/prepare_system.rb b/resources/recipes/prepare_system.rb index e9a88df8..dd996fa6 100644 --- a/resources/recipes/prepare_system.rb +++ b/resources/recipes/prepare_system.rb @@ -108,12 +108,12 @@ node.default['redborder']['zookeeper']['zk_hosts'] = "zookeeper.service.#{node['redborder']['cdomain']}:#{node['redborder']['zookeeper']['port']}" # Set all nodes with s3 configured (nginx load balancer) -s3_hosts = node["redborder"]["managers_per_services"]["s3"].map {|z| "#{z}.node:9000"} -node.default["redborder"]["s3"]["s3_hosts"] = s3_hosts +s3_hosts = node['redborder']['managers_per_services']['s3'].map { |z| "#{z}.node:9000" } +node.default['redborder']['s3']['s3_hosts'] = s3_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) +# 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) end # set druid realtime partition id (its needed in cluster mode for druid brokers)