Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement/19886 external memcached #266

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions resources/recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
# action :nothing
# end

begin
external_services = data_bag_item('rBglobal', 'external_services')
rescue
external_services = {}
end

rb_common_config 'Configure common' do
action :configure
end
Expand Down Expand Up @@ -243,7 +249,7 @@
end

memcached_config 'Configure Memcached' do
if manager_services['memcached']
if manager_services['memcached'] && external_services['memcached'] == 'onpremise'
memory node['redborder']['memory_services']['memcached']['memory']
ipaddress node['ipaddress_sync']
action [:add, :register]
Expand Down Expand Up @@ -346,6 +352,7 @@
port node['redborder']['webui']['port']
webui_version node['redborder']['webui']['version']
redborder_version node['redborder']['repo']['version']
elasticache_hosts node['redborder']['memcached']['hosts']
action [:add, :register, :configure_rsa]
else
action [:remove, :deregister]
Expand Down Expand Up @@ -453,6 +460,7 @@
device_nodes node.run_state['sensors_info_all']['device-sensor']
intrusion_incidents_priority_filter node['redborder']['intrusion_incidents_priority_filter']
vault_incidents_priority_filter node['redborder']['vault_incidents_priority_filter']
memcached_server node['redborder']['memcached']['hosts']
logstash_pipelines node.run_state['pipelines']
split_traffic_logstash split_traffic
split_intrusion_logstash split_intrusion
Expand Down Expand Up @@ -613,13 +621,6 @@
end
end

# Determine external
begin
external_services = data_bag_item('rBglobal', 'external_services')
rescue
external_services = {}
end

postgresql_config 'Configure postgresql' do
if manager_services['postgresql'] && external_services['postgresql'] == 'onpremise'
cdomain node['redborder']['cdomain']
Expand Down
12 changes: 9 additions & 3 deletions resources/recipes/prepare_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,16 @@
elasticache = {}
end

if !elasticache.empty?
node.default['redborder']['memcached']['server_list'] = getElasticacheNodes(elasticache['cfg_address'], elasticache['cfg_port'])
# Previous code treated memcached hosts as an array of strings, but now it is a single string.
# if !elasticache.empty?
# node.default['redborder']['memcached']['server_list'] = getElasticacheNodes(elasticache['cfg_address'], elasticache['cfg_port'])
# node.default['redborder']['memcached']['port'] = elasticache['cfg_port']
# node.default['redborder']['memcached']['hosts'] = joinHostArray2port(node['redborder']['memcached']['server_list'], node['redborder']['memcached']['port']).join(',')
# node.default['redborder']['memcached']['elasticache'] = true
if !elasticache.empty? && !elasticache['cfg_address'].nil? && !elasticache['cfg_port'].nil?
node.default['redborder']['memcached']['server_list'] = elasticache['cfg_address']
node.default['redborder']['memcached']['port'] = elasticache['cfg_port']
node.default['redborder']['memcached']['hosts'] = joinHostArray2port(node['redborder']['memcached']['server_list'], node['redborder']['memcached']['port']).join(',')
node.default['redborder']['memcached']['hosts'] = "#{elasticache['cfg_address']}:#{elasticache['cfg_port']}"
node.default['redborder']['memcached']['elasticache'] = true
else
memcached_hosts = []
Expand Down
Loading