Commit 01738c9d authored by Jesse Pretorius's avatar Jesse Pretorius Committed by Sean OMeara
Browse files

[COOK-3876] rate_limits for rsyslog


Signed-off-by: default avatarSean OMeara <someara@opscode.com>
parent bf10683a
driver_plugin: 'vagrant'
---
driver_plugin: vagrant
driver_plugin: digitalocean
driver_config:
require_chef_omnibus: true
digitalocean_client_id: <%= ENV['DIGITAL_OCEAN_CLIENT_ID'] %>
digitalocean_api_key: <%= ENV['DIGITAL_OCEAN_API_KEY'] %>
aws_access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
aws_secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
aws_ssh_key_id: <%= ENV['AWS_KEYPAIR_NAME'] %>
ssh_key: <%= ENV['AWS_PRIVATE_KEY_PATH'] %>
rackspace_username: <%= ENV['RACKSPACE_USERNAME'] %>
rackspace_api_key: <%= ENV['RACKSPACE_API_KEY'] %>
require_chef_omnibus: latest
platforms:
- name: ubuntu-12.04
run_list:
- recipe[apt]
- name: ubuntu-10.04
run_list:
- recipe[apt]
- name: centos-6.4
- name: centos-5.9
- name: omnios-r151006c
driver_config:
box: omnios-r151006c
box_url: http://omnios.omniti.com/media/OmniOS_r151006c-r1.box
# - name: omnios-r151006c
# driver_plugin: ec2
# driver_config:
# image_id: ami-35eb835c
# username: root
- name: centos-5.8
driver_plugin: digitalocean
driver_config:
image_id: 1601
flavor_id: 63
region_id: 4
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
- name: centos-6.4
driver_plugin: digitalocean
driver_config:
image_id: 562354
flavor_id: 63
region_id: 4
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
- name: amazon-2013.09
driver_plugin: ec2
driver_config:
image_id: ami-3be4bc52
username: ec2-user
- name: ubuntu-1004
driver_plugin: digitalocean
driver_config:
image_id: 14097
flavor_id: 63
region_id: 4
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
run_list:
- recipe[apt]
- name: ubuntu-1204
driver_plugin: digitalocean
driver_config:
image_id: 1505447
flavor_id: 63
region_id: 4
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
run_list:
- recipe[apt]
suites:
- name: default
......@@ -38,4 +83,4 @@ suites:
server_ip: 10.0.0.50
- name: server
run_list:
- recipe[rsyslog::server]
- recipe[rsyslog::server]
\ No newline at end of file
source 'http://rubygems.org'
source 'https://rubygems.org'
gem 'berkshelf', '~> 2.0'
gem 'chefspec', '~> 2.0'
gem 'foodcritic', '~> 2.2'
gem 'rubocop', '~> 0.12'
gem 'chefspec', '~> 3.0'
gem 'foodcritic', '~> 3.0'
gem 'rubocop'
group :integration do
gem 'test-kitchen', '~> 1.0.0.beta'
gem 'test-kitchen', '~> 1.0'
gem 'kitchen-vagrant', '~> 0.11'
gem 'kitchen-digitalocean'
gem 'kitchen-ec2'
end
......@@ -42,6 +42,9 @@ See `attributes/default.rb` for default values.
* `node['rsyslog']['logs_to_forward']` - Specifies what logs should be sent to the remote rsyslog server. Default is all ( \*.\* ).
* `node['rsyslog']['default_log_dir']` - log directory used in `50-default.conf` template, defaults to `/var/log`
* `node['rsyslog']['default_facility_logs']` - Hash containing log facilities and destinations used in `50-default.conf` template.
* `node['rsyslog']['rate_limit_interval']` - Value of the $SystemLogRateLimitInterval configuration directive in `/etc/rsyslog.conf`. Default is nil, leaving it to the platform default.
* `node['rsyslog']['rate_limit_burst']` - Value of the $SystemLogRateLimitBurst configuration directive in `/etc/rsyslog.conf`. Default is nil, leaving it to the platform default.
Recipes
-------
......
......@@ -34,6 +34,8 @@ default['rsyslog']['repeated_msg_reduction'] = 'on'
default['rsyslog']['logs_to_forward'] = '*.*'
default['rsyslog']['enable_imklog'] = true
default['rsyslog']['config_prefix'] = '/etc'
default['rsyslog']['rate_limit_interval'] = nil
default['rsyslog']['rate_limit_burst'] = nil
# The most likely platform-specific attributes
default['rsyslog']['service_name'] = 'rsyslog'
......
......@@ -67,6 +67,19 @@ $Umask 0022
$PrivDropToUser <%= node['rsyslog']['user'] %>
$PrivDropToGroup <%= node['rsyslog']['group'] %>
<% end %>
<% unless node['rsyslog']['rate_limit_interval'].nil? %>
#
# Set the amount of time that is being measured for rate limiting
#
$SystemLogRateLimitInterval <%= node['rsyslog']['rate_limit_interval'] %>
<% end %>
<% unless node['rsyslog']['rate_limit_burst'].nil? %>
#
# Set the amount of messages, that have to occur in the time limit of
# SystemLogRateLimitInterval, to trigger rate limiting
#
$SystemLogRateLimitBurst <%= node['rsyslog']['rate_limit_burst'] %>
<% end %>
#
# Include all config files in <%= node['rsyslog']['config_prefix'] %>/rsyslog.d/
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment