From aba2abf8d3347fb892d3f48825c052f5b83b4f50 Mon Sep 17 00:00:00 2001 From: Miguel Alvarez Date: Wed, 22 Jan 2025 12:13:18 +0000 Subject: [PATCH] Fix rb-secor --- resources/providers/config.rb | 40 ++++++++++++++++++- resources/templates/default/mem_sysconfig.erb | 1 + 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 resources/templates/default/mem_sysconfig.erb diff --git a/resources/providers/config.rb b/resources/providers/config.rb index 9440d4e..6d2b951 100755 --- a/resources/providers/config.rb +++ b/resources/providers/config.rb @@ -86,7 +86,23 @@ mode 0770 action :create end - + + directory "/var/log/secor" do + owner "secor" + group "secor" + mode 0770 + recursive true + action :create + end + + directory "/var/log/secor-vault" do + owner "secor" + group "secor" + mode 0770 + recursive true + action :create + end + template "/var/secor/secor.common.properties" do source "secor.common.properties.erb" cookbook 'secor' @@ -97,7 +113,29 @@ variables(:s3_hostname => s3_hostname, :s3_user => s3_user, :s3_pass => s3_pass, :s3_bucket => s3_bucket) notifies :restart, "service[rb-secor]", :delayed if manager_services["secor"] end + + template "/etc/sysconfig/secor" do + source "mem_sysconfig.erb" + cookbook 'secor' + owner "secor" + group "secor" + mode 0644 + retries 2 + variables(:memory => node['redborder']['memory_services']['secor']['memory']) + notifies :restart, "service[rb-secor]", :delayed if manager_services["secor"] + end + template "/etc/sysconfig/secor-vault" do + source "mem_sysconfig.erb" + cookbook 'secor' + owner "secor" + group "secor" + mode 0644 + retries 2 + variables(:memory => node['redborder']['memory_services']['secor-vault']['memory']) + notifies :restart, "service[rb-secor-vault]", :delayed if manager_services["secor-vault"] + end + template "/var/secor/log4j.prod.properties" do source "secor_log4j.prod.properties.erb" cookbook 'secor' diff --git a/resources/templates/default/mem_sysconfig.erb b/resources/templates/default/mem_sysconfig.erb new file mode 100644 index 0000000..8044d39 --- /dev/null +++ b/resources/templates/default/mem_sysconfig.erb @@ -0,0 +1 @@ +MEMTOTAL=<%=@memory%> \ No newline at end of file