diff --git a/resources/attributes/default.rb b/resources/attributes/default.rb index 77d65cf..940ed2b 100644 --- a/resources/attributes/default.rb +++ b/resources/attributes/default.rb @@ -82,7 +82,6 @@ default['redborder']['memory_services']['redborder-mem2incident'] = { 'count': 5, 'memory': 0 } default['redborder']['memory_services']['redborder-monitor'] = { 'count': 5, 'memory': 0, 'max_limit': 20000 } default['redborder']['memory_services']['redborder-nmsp'] = { 'count': 10, 'memory': 0 } -default['redborder']['memory_services']['redborder-postgresql'] = { 'count': 5, 'memory': 0 } default['redborder']['memory_services']['snmp'] = { 'count': 5, 'memory': 0, 'max_limit': 10000 } default['redborder']['memory_services']['webui'] = { 'count': 40, 'memory': 0 } default['redborder']['memory_services']['zookeeper'] = { 'count': 20, 'memory': 0 } @@ -101,7 +100,7 @@ # geoip has been removed because is not a service default['redborder']['services_group']['full'] = %w(consul chef-server zookeeper memcached rsyslog kafka logstash s3 - postgresql redborder-postgresql nginx webui rb-workers druid-broker + postgresql nginx webui rb-workers druid-broker druid-historical druid-realtime druid-coordinator f2k redborder-monitor sfacctd redborder-dswatcher mongodb redborder-events-counter http2k redborder-mem2incident) @@ -117,7 +116,7 @@ default['redborder']['services_group']['webui'] = %w(consul nginx webui rb-workers) default['redborder']['services_group']['f2k'] = %w(consul f2k) default['redborder']['services_group']['s3'] = %w(consul nginx s3) -default['redborder']['services_group']['postgresql'] = %w(consul postgresql redborder-postgresql) +default['redborder']['services_group']['postgresql'] = %w(consul postgresql) default['redborder']['services'] = {} default['redborder']['services']['chef-client'] = true @@ -155,7 +154,6 @@ default['redborder']['services']['redborder-mem2incident'] = false default['redborder']['services']['redborder-monitor'] = true default['redborder']['services']['redborder-nmsp'] = false -default['redborder']['services']['redborder-postgresql'] = false default['redborder']['services']['redborder-scanner'] = false default['redborder']['services']['rsyslog'] = true default['redborder']['services']['s3'] = false @@ -199,7 +197,6 @@ default['redborder']['systemdservices']['redborder-mem2incident'] = ['redborder-mem2incident'] default['redborder']['systemdservices']['redborder-monitor'] = ['redborder-monitor'] default['redborder']['systemdservices']['redborder-nmsp'] = ['redborder-nmsp'] -default['redborder']['systemdservices']['redborder-postgresql'] = ['redborder-postgresql'] default['redborder']['systemdservices']['redborder-scanner'] = ['redborder-scanner'] default['redborder']['systemdservices']['rsyslog'] = ['rsyslog'] default['redborder']['systemdservices']['s3'] = ['minio'] @@ -215,7 +212,7 @@ default['redborder']['druid']['historical']['maxsize'] = -1 # Virtual Ips -default['redborder']['manager']['virtual_ips'] = { external: [ { service: 'webui', deps: ['nginx'] }, { service: 'f2k' }, { service: 'sfacctd' }, { service: 'kafka' } ] } +default['redborder']['manager']['virtual_ips'] = { internal: [{ service: 'postgresql' }], external: [{ service: 'webui', deps: ['nginx'] }, { service: 'f2k' }, { service: 'sfacctd' }, { service: 'kafka' }] } # Realtime default['redborder']['druid']['realtime']['partition_num'] = 0 diff --git a/resources/libraries/get_virtual_ip_info.rb b/resources/libraries/get_virtual_ip_info.rb index 4763fdb..398c2fc 100644 --- a/resources/libraries/get_virtual_ip_info.rb +++ b/resources/libraries/get_virtual_ip_info.rb @@ -26,7 +26,11 @@ def get_virtual_ip_info(managers) hash['virtual'] = true hash['run_anywhere'] = true has_any_virtual_ip = true if hash['ip'] && manager_services[service['service']] - hash['iface'] = node['redborder']['management_interface'] + if type.to_s == 'external' + hash['iface'] = node['redborder']['management_interface'] + elsif type.to_s == 'internal' + hash['iface'] = node['redborder']['sync_interface'] + end if manager_services[service['service']] all_deps_enabled = true unless service['deps'].nil? @@ -44,7 +48,11 @@ def get_virtual_ip_info(managers) hash['run_anywhere'] = false nodeservice = nil managers.each do |m| - hash['iface'] = node['redborder']['management_interface'] + if type.to_s == 'external' + hash['iface'] = node['redborder']['management_interface'] + elsif type.to_s == 'internal' + hash['iface'] = node['redborder']['sync_interface'] + end run_anywhere_flag = false if m.name == node.name @@ -61,7 +69,11 @@ def get_virtual_ip_info(managers) if nodeservice.nil? managers.each do |m| - hash['iface'] = node['redborder']['management_interface'] + if type.to_s == 'external' + hash['iface'] = node['redborder']['management_interface'] + elsif type.to_s == 'internal' + hash['iface'] = node['redborder']['sync_interface'] + end run_anywhere_flag = false run_anywhere_flag = m['redborder']['manager']['services']['overwrite'][service['service']] unless m['redborder']['manager']['services']['overwrite'].nil? run_anywhere_flag = m['redborder']['manager']['services'][m['redborder']['manager']['mode']][service['service']] if run_anywhere_flag != true && !m['redborder']['manager']['services'][m['redborder']['manager']['mode']].nil? diff --git a/resources/recipes/configure.rb b/resources/recipes/configure.rb index 4dad7b4..bb663a8 100644 --- a/resources/recipes/configure.rb +++ b/resources/recipes/configure.rb @@ -110,6 +110,23 @@ 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'] + ipaddress node['ipaddress_sync'] + action [:add, :register] + else + action [:remove, :deregister] + end +end + zookeeper_config 'Configure Zookeeper' do if manager_services['zookeeper'] port node['zookeeper']['port'] @@ -605,23 +622,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'] - ipaddress node['ipaddress_sync'] - action [:add, :register] - else - action [:remove, :deregister] - end -end - s3_secrets = {} begin