Skip to content

Commit

Permalink
Merge pull request #4 from redBorder/development
Browse files Browse the repository at this point in the history
Release 1.0.6
  • Loading branch information
manegron authored May 30, 2024
2 parents 81ad51e + 5bf45f4 commit b1323e6
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 178 deletions.
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
cookbook rsyslog CHANGELOG
==========================
cookbook-rsyslog CHANGELOG
===============

## 1.0.6

- Miguel Negron
- [805eb97] Lint providers 3
- [34948b5] Lint helper
- [ab3cdd0] Lint providers 2
- [e82d22b] Lint providers
- [c463f4c] Lint recipes
- [3cac460] Lint resources
- [4ffefe7] Lint attributes
- [5c607bd] Update metadata.rb

0.0.1
-----
Expand Down
58 changes: 29 additions & 29 deletions resources/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
default["rsyslog"]["registered"] = false
default["redborder"]["rsyslog"]["enable_tcp"] = true
default["redborder"]["rsyslog"]["enable_tls"] = false
default["redborder"]["rsyslog"]["enable_udp"] = true
default["redborder"]["rsyslog"]["enable_client_proxy_logs"] = true
default["redborder"]["rsyslog"]["udp_port"] = 514
default["redborder"]["rsyslog"]["tcp_port"] = 514
default['rsyslog']['registered'] = false
default['redborder']['rsyslog']['enable_tcp'] = true
default['redborder']['rsyslog']['enable_tls'] = false
default['redborder']['rsyslog']['enable_udp'] = true
default['redborder']['rsyslog']['enable_client_proxy_logs'] = true
default['redborder']['rsyslog']['udp_port'] = 514
default['redborder']['rsyslog']['tcp_port'] = 514

default["redborder"]["rsyslog"]["enable_hash"] = false
default["redborder"]["rsyslog"]["hash_key"] = "yourenterprisekey"
default["redborder"]["rsyslog"]["hash_function"] = "sha256"
default['redborder']['rsyslog']['enable_hash'] = false
default['redborder']['rsyslog']['hash_key'] = 'yourenterprisekey'
default['redborder']['rsyslog']['hash_function'] = 'sha256'

default["redborder"]["rsyslog"]["config_dir"] = "/etc/rsyslog.d"
default["redborder"]["rsyslog"]["certificates_dir"] = "#{node["redborder"]["rsyslog"]["config_dir"]}/certificates"
default["redborder"]["rsyslog"]["rules_dir"] = "#{node["redborder"]["rsyslog"]["config_dir"]}/rules"
default["redborder"]["rsyslog"]["remote_logs_dir"] = "/var/log/remote"
default["redborder"]["rsyslog"]["work_dir"] = "/var/spool/rsyslog"
default['redborder']['rsyslog']['config_dir'] = '/etc/rsyslog.d'
default['redborder']['rsyslog']['certificates_dir'] = "#{node['redborder']['rsyslog']['config_dir']}/certificates"
default['redborder']['rsyslog']['rules_dir'] = "#{node['redborder']['rsyslog']['config_dir']}/rules"
default['redborder']['rsyslog']['remote_logs_dir'] = '/var/log/remote'
default['redborder']['rsyslog']['work_dir'] = '/var/spool/rsyslog'

default["redborder"]["rsyslog"]["permitted_peers_array"] = ['*.example.com','*.redborder.com']
default['redborder']['rsyslog']['permitted_peers_array'] = ['*.example.com', '*.redborder.com']

default["redborder"]["rsyslog"]["user"] = "root"
default["redborder"]["rsyslog"]["group"] = "root"
default['redborder']['rsyslog']['user'] = 'root'
default['redborder']['rsyslog']['group'] = 'root'

# From old attributes file
#default["redborder"]["rsyslog"]["service"] = "rsyslog"
default["redborder"]["rsyslog"]["is_server"] = false
default["redborder"]["rsyslog"]["loggly"] = {}
default["redborder"]["rsyslog"]["loggly"]["token"] = ""
default["redborder"]["rsyslog"]["service"] = "rsyslog"
default["redborder"]["rsyslog"]["tcpservers"] = []
default["redborder"]["rsyslog"]["udpservers"] = []
default["redborder"]["rsyslog"]["servers"] = []
default["redborder"]["rsyslog"]["protocol"] = "udp"
default["redborder"]["rsyslog"]["syslog_mode"] = "extended"
default["redborder"]["rsyslog"]["savelocally"] = true
# default['redborder']['rsyslog']['service'] = 'rsyslog'
default['redborder']['rsyslog']['is_server'] = false
default['redborder']['rsyslog']['loggly'] = {}
default['redborder']['rsyslog']['loggly']['token'] = ''
default['redborder']['rsyslog']['service'] = 'rsyslog'
default['redborder']['rsyslog']['tcpservers'] = []
default['redborder']['rsyslog']['udpservers'] = []
default['redborder']['rsyslog']['servers'] = []
default['redborder']['rsyslog']['protocol'] = 'udp'
default['redborder']['rsyslog']['syslog_mode'] = 'extended'
default['redborder']['rsyslog']['savelocally'] = true
28 changes: 9 additions & 19 deletions resources/libraries/helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Rsyslog
module Helper

def get_vault_nodes
# return a list of the vault nodes
vault_nodes = []
Expand All @@ -19,23 +18,18 @@ def get_vault_nodes
end
end

unless roles.nil?
if !roles.empty? and !roles.include?("manager")
if m.respond_to?"run_list" and (m.run_list.map{|x| x.name}.include?"vault-sensor" or m.run_list.map{|x| x.name}.include?"cep-sensor")
vault_nodes << m
end
end
next unless roles && !roles.empty? && !roles.include?('manager')

if m.respond_to?('run_list') && (m.run_list.map(&:name).include?('vault-sensor') || m.run_list.map(&:name).include?('cep-sensor'))
vault_nodes << m
end
end
vault_nodes

end

def get_ips_nodes
# return a list of the vault nodes
managers = []
managers_all = []
ips_nodes = []
ips_nodes = []

managers_keys = Chef::Node.list.keys.sort
managers_keys.each do |m_key|
Expand All @@ -51,17 +45,13 @@ def get_ips_nodes
end
end

unless roles.nil?
if !roles.empty? and !roles.include?("manager")
if m.respond_to?"run_list" and (m.run_list.map{|x| x.name}.include?"ips-sensor" or m.run_list.map{|x| x.name}.include?"ipsv2-sensor" or m.run_list.map{|x| x.name}.include?"ipscp-sensor")
ips_nodes << m
end
end
next unless roles && !roles.empty? && !roles.include?('manager')

if m.respond_to?('run_list') && (m.run_list.map(&:name).include?('ips-sensor') || m.run_list.map(&:name).include?('ipsv2-sensor') || m.run_list.map(&:name).include?('ipscp-sensor'))
ips_nodes << m
end
end
ips_nodes

end

end
end
9 changes: 4 additions & 5 deletions resources/metadata.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name 'rsyslog'
maintainer 'Javier Rodríguez & Jordi Hernández'
maintainer_email 'javiercrg@redborder.com, jhernandez@redborder.com'
license "AGPL"
maintainer 'Eneo Tecnología S.L.'
maintainer_email 'git@redborder.com'
license 'AGPL-3.0'
description 'Installs/Configures rsyslog in redborder manager'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.0.5'
version '1.0.6'
Loading

0 comments on commit b1323e6

Please sign in to comment.