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

Release 1.7.7 #128

Merged
merged 3 commits into from
May 2, 2024
Merged
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
cookbook-rb-manager CHANGELOG
===============

## 1.7.7

- nilsver
- [3268d47] imported logstash template from centos6

## 1.7.6

- Miguel Álvarez
Expand Down
38 changes: 38 additions & 0 deletions resources/libraries/get_pipelines.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module Rb_manager
module Helpers

def get_pipelines()
logstash_pipelines = []
sensors = node["redborder"]["sensors_info_all"]
namespaces = get_namespaces()
main_logstash = determine_main_logstash_node()

if manager_services["logstash"]
logstash_pipelines.push("rbwindow-pipeline") if main_logstash == node.name
logstash_pipelines.push("apstate-pipeline")
logstash_pipelines.push("scanner-pipeline") unless sensors["scanner-sensor"].empty?
logstash_pipelines.push("nmsp-pipeline") if main_logstash == node.name and !sensors["flow-sensor"].empty?
logstash_pipelines.push("radius-pipeline") if main_logstash == node.name
logstash_pipelines.push("vault-pipeline") unless sensors["vault-sensor"].empty?
logstash_pipelines.push("netflow-pipeline") unless sensors["flow-sensor"].empty?
logstash_pipelines.push("sflow-pipeline") unless sensors["flow-sensor"].empty?
logstash_pipelines.push("meraki-pipeline") unless sensors["meraki-sensor"].empty?
logstash_pipelines.push("monitor-pipeline") unless namespaces.empty?
logstash_pipelines.push("location-pipeline") unless sensors["ale-sensor"].empty? or sensors["mse-sensor"].empty? or sensors["flow-sensor"].empty? or sensors["arubacentral-sensor"].empty?
logstash_pipelines.push("mobility-pipeline")
logstash_pipelines.push("redfish-pipeline") unless sensors["device-sensor"].empty?
logstash_pipelines.push("bulkstats-pipeline") unless sensors["device-sensor"].empty?
end
end

# The main logstash is a node where both memcached and logstash are running or the first logstash node (order by name).
# This main logasths node is gonna run the pipelines rbwindow, location, mobility, nmsp, meraki and radius
# Those pipelines should only run in one node (the main_logstash node) for now..
def determine_main_logstash_node()
memcached_nodes = managers_per_service["memcached"].sort.uniq
logstash_nodes = managers_per_service["logstash"].sort.uniq
main_logstash_nodes = memcached_nodes & logstash_nodes
main_logstash_nodes.first || logstash_nodes.first
end
end
end
2 changes: 1 addition & 1 deletion resources/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'All rights reserved'
description 'Installs/Configures redborder manager'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.7.6'
version '1.7.7'

depends 'chef-server'
depends 'zookeeper'
Expand Down
1 change: 1 addition & 0 deletions resources/recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@
vault_nodes node["redborder"]["sensors_info_all"]["vault-sensor"]
scanner_nodes node["redborder"]["sensors_info_all"]["scanner-sensor"]
device_nodes node["redborder"]["sensors_info_all"]["device-sensor"]
logstash_pipelines node["redborder"]["logstash"]["pipelines"]
action (manager_services["logstash"] ? [:add, :register] : [:remove, :deregister])
end

Expand Down
5 changes: 4 additions & 1 deletion resources/recipes/prepare_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
node.default["redborder"]["services"]["consul-client"] = true
end

#Set :ipaddress_sync
#Set :ipaddress_sync
ipaddress_sync=node["ipaddress"]
sync_net = `cat /etc/redborder/rb_init_conf.yml | grep sync_net | awk '{print $2'} | sed 's|/.*||'`.strip
node['network']['interfaces'].each do |interface, details|
Expand Down Expand Up @@ -95,6 +95,9 @@
#get sensors info of all flow sensors
node.default["redborder"]["all_flow_sensors_info"] = get_all_flow_sensors_info()

#get logstash pipelines
node.default["redborder"]["logstash"]["pipelines"] = get_pipelines()

#get namespaces
node.default["redborder"]["namespaces"] = get_namespaces

Expand Down
Loading