Merge pull request #480 from bogdando/fix_logclient

Fix logclient
This commit is contained in:
Vladimir Kuklin 2013-08-21 02:19:22 -07:00
commit e99200617c
53 changed files with 867 additions and 363 deletions

View File

@ -4,8 +4,7 @@
# $osapi_volume_extension = cinder.api.openstack.volume.contrib.standard_extensions
# $root_helper = sudo /usr/local/bin/cinder-rootwrap /etc/cinder/rootwrap.conf
# $use_syslog = Rather or not service should log to syslog. Optional.
# $syslog_log_facility = Facility for syslog, if used. Optional. Note: duplicating conf option
# wouldn't have been used, but more powerfull rsyslog features managed via conf template instead
# $syslog_log_facility = Facility for syslog, if used. Optional.
# $syslog_log_level = logging level for non verbose and non debug mode. Optional.
class cinder::base (
@ -30,6 +29,7 @@ class cinder::base (
$use_syslog = false,
$syslog_log_facility = "LOCAL3",
$syslog_log_level = 'WARNING',
$log_dir = '/var/log/cinder',
) {
include cinder::params
@ -58,27 +58,46 @@ class cinder::base (
require => Package['cinder'],
}
if $use_syslog {
if $use_syslog and !$debug =~ /(?i)(true|yes)/ {
cinder_config {
'DEFAULT/log_config': value => "/etc/cinder/logging.conf";
'DEFAULT/log_file': ensure=> absent;
'DEFAULT/logdir': ensure=> absent;
'DEFAULT/log_file': ensure=> absent;
'DEFAULT/log_dir': ensure=> absent;
'DEFAULT/logfile': ensure=> absent;
'DEFAULT/logdir': ensure=> absent;
'DEFAULT/use_stderr': ensure=> absent;
'DEFAULT/use_syslog': value => true;
'DEFAULT/syslog_log_facility': value => $syslog_log_facility;
}
file { "cinder-logging.conf":
content => template('cinder/logging.conf.erb'),
path => "/etc/cinder/logging.conf",
require => File[$::cinder::params::cinder_conf],
}
# We must notify services to apply new logging rules
File['cinder-logging.conf'] ~> Service<| title == 'cinder-api' |>
File['cinder-logging.conf'] ~> Service<| title == 'cinder-volume' |>
File['cinder-logging.conf'] ~> Service<| title == 'cinder-scheduler' |>
}
else {
cinder_config {'DEFAULT/log_config': ensure=>absent;}
cinder_config {
'DEFAULT/log_config': ensure=> absent;
'DEFAULT/use_syslog': ensure=> absent;
'DEFAULT/syslog_log_facility': ensure=> absent;
'DEFAULT/use_stderr': ensure=> absent;
'DEFAULT/logdir':value=> $log_dir;
'DEFAULT/logging_context_format_string':
value => '%(asctime)s %(levelname)s %(name)s [%(request_id)s %(user_id)s %(project_id)s] %(instance)s %(message)s';
'DEFAULT/logging_default_format_string':
value => '%(asctime)s %(levelname)s %(name)s [-] %(instance)s %(message)s';
}
# might be used for stdout logging instead, if configured
file { "cinder-logging.conf":
content => template('cinder/logging.conf-nosyslog.erb'),
path => "/etc/cinder/logging.conf",
require => File[$::cinder::params::cinder_conf],
}
}
# We must notify services to apply new logging rules
File['cinder-logging.conf'] ~> Service<| title == "$::cinder::params::api_service" |>
File['cinder-logging.conf'] ~> Service<| title == "$::cinder::params::volume_service" |>
File['cinder-logging.conf'] ~> Service<| title == "$::cinder::params::scheduler_service" |>
file { $::cinder::params::cinder_conf: }
file { $::cinder::params::cinder_paste_api_ini: }
@ -138,7 +157,6 @@ else {
'DEFAULT/debug': value => $debug;
'DEFAULT/verbose': value => $verbose;
'DEFAULT/api_paste_config': value => '/etc/cinder/api-paste.ini';
'DEFAULT/use_syslog': value => $use_syslog;
}
exec { 'cinder-manage db_sync':
command => $::cinder::params::db_sync_command,
@ -152,7 +170,7 @@ else {
Cinder_config<||> -> Exec['cinder-manage db_sync']
Nova_config<||> -> Exec['cinder-manage db_sync']
Cinder_api_paste_ini<||> -> Exec['cinder-manage db_sync']
Exec['cinder-manage db_sync'] -> Service<| title == 'cinder-api' |>
Exec['cinder-manage db_sync'] -> Service<| title == 'cinder-volume' |>
Exec['cinder-manage db_sync'] -> Service<| title == 'cinder-scheduler' |>
Exec['cinder-manage db_sync'] -> Service<| title == $::cinder::params::api_service |>
Exec['cinder-manage db_sync'] -> Service<| title == $::cinder::params::volume_service |>
Exec['cinder-manage db_sync'] -> Service<| title == $::cinder::params::scheduler_service |>
}

View File

@ -0,0 +1,24 @@
[loggers]
keys = root
[handlers]
keys = root
[formatters]
keys = default
[formatter_default]
format=%(asctime)s %(levelname)s %(name)s:%(lineno)d %(message)s
[logger_root]
level=NOTSET
handlers = root
propagate = 1
[handler_root]
class = StreamHandler
level=NOTSET
formatter = default
args = (sys.stdout,)

View File

@ -1,18 +1,16 @@
[loggers]
keys = root
# devel is reserved for future usage
[handlers]
keys = production,devel
keys = production,devel,stderr
[formatters]
keys = normal,debug
[logger_root]
level = NOTSET
handlers = production
handlers = production,devel,stderr
propagate = 1
#qualname = cinder
[formatter_debug]
format = cinder-%(name)s %(levelname)s: %(module)s %(funcName)s %(message)s
@ -20,22 +18,46 @@ format = cinder-%(name)s %(levelname)s: %(module)s %(funcName)s %(message)s
[formatter_normal]
format = cinder-%(name)s %(levelname)s: %(message)s
# Extended logging info to LOG_<%= @syslog_log_facility %> with debug:<%= @debug %> and verbose:<%= @verbose %>
# Note: local copy goes to /var/log/cinder-all.log
# logging info to LOG_<%= @syslog_log_facility %> with debug:<%= @debug %> and verbose:<%= @verbose %>
[handler_production]
class = handlers.SysLogHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = ('/dev/log', handlers.SysLogHandler.LOG_<%= @syslog_log_facility %>)
formatter = normal
# TODO find out how it could be usefull and how it should be used
[handler_stderr]
class = StreamHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = (sys.stderr,)
[handler_devel]
class = StreamHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = (sys.stdout,)

View File

@ -78,13 +78,6 @@ class glance::api(
require => Class['glance'],
}
if !defined(File["glance-logging.conf"]) {
file {"glance-logging.conf":
content => template('glance/logging.conf.erb'),
path => "/etc/glance/logging.conf",
}
}
if($sql_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
require 'mysql::python'
} elsif($sql_connection =~ /postgresql:\/\/\S+:\S+@\S+\/\S+/) {
@ -94,18 +87,43 @@ class glance::api(
} else {
fail("Invalid db connection ${sql_connection}")
}
if $use_syslog {
if $use_syslog and !$debug =~ /(?i)(true|yes)/ {
glance_api_config {
'DEFAULT/log_config': value => "/etc/glance/logging.conf";
'DEFAULT/log_file': ensure=> absent;
'DEFAULT/logdir': ensure=> absent;
'DEFAULT/log_dir': ensure=> absent;
'DEFAULT/logfile': ensure=> absent;
'DEFAULT/logdir': ensure=> absent;
'DEFAULT/use_stderr': ensure=> absent;
'DEFAULT/use_syslog': value => true;
'DEFAULT/syslog_log_facility': value => $syslog_log_facility;
}
if !defined(File["glance-logging.conf"]) {
file {"glance-logging.conf":
content => template('glance/logging.conf.erb'),
path => "/etc/glance/logging.conf",
}
}
} else {
glance_api_config {
'DEFAULT/log_config': ensure => absent;
'DEFAULT/log_file': value=> $log_file;
'DEFAULT/log_config': ensure=> absent;
'DEFAULT/use_syslog': ensure=> absent;
'DEFAULT/syslog_log_facility': ensure=> absent;
'DEFAULT/use_stderr': ensure=> absent;
'DEFAULT/log_file':value=> $log_file;
'DEFAULT/logging_context_format_string':
value => '%(asctime)s %(levelname)s %(name)s [%(request_id)s %(user_id)s %(project_id)s] %(instance)s %(message)s';
'DEFAULT/logging_default_format_string':
value => '%(asctime)s %(levelname)s %(name)s [-] %(instance)s %(message)s';
}
# might be used for stdout logging instead, if configured
if !defined(File["glance-logging.conf"]) {
file {"glance-logging.conf":
content => template('glance/logging.conf-nosyslog.erb'),
path => "/etc/glance/logging.conf",
}
}
}
# basic service config
@ -116,7 +134,6 @@ if $use_syslog {
'DEFAULT/bind_port': value => $bind_port;
'DEFAULT/backlog': value => $backlog;
'DEFAULT/workers': value => $workers;
'DEFAULT/use_syslog': value => $use_syslog;
'DEFAULT/registry_client_protocol': value => "http";
'DEFAULT/delayed_delete': value => "False";
'DEFAULT/scrub_time': value => "43200";

View File

@ -21,17 +21,51 @@ class glance::registry(
$syslog_log_facility = 'LOCAL2',
$syslog_log_level = 'WARNING',
) inherits glance {
if $use_syslog {
File {
ensure => present,
owner => 'glance',
group => 'glance',
mode => '0640',
notify => Service['glance-registry'],
require => Class['glance']
}
if $use_syslog and !$debug =~ /(?i)(true|yes)/ {
glance_registry_config {
'DEFAULT/log_config': value => "/etc/glance/logging.conf";
'DEFAULT/log_file': ensure=> absent;
'DEFAULT/logdir': ensure=> absent;
'DEFAULT/log_dir': ensure=> absent;
'DEFAULT/logfile': ensure=> absent;
'DEFAULT/logdir': ensure=> absent;
'DEFAULT/use_stderr': ensure=> absent;
'DEFAULT/use_syslog': value => true;
'DEFAULT/syslog_log_facility': value => $syslog_log_facility;
}
if !defined(File["glance-logging.conf"]) {
file {"glance-logging.conf":
content => template('glance/logging.conf.erb'),
path => "/etc/glance/logging.conf",
}
}
} else {
glance_registry_config {
'DEFAULT/log_config': ensure => absent;
'DEFAULT/log_file': value => $log_file;
'DEFAULT/log_config': ensure=> absent;
'DEFAULT/use_syslog': ensure=> absent;
'DEFAULT/syslog_log_facility': ensure=> absent;
'DEFAULT/use_stderr': ensure=> absent;
'DEFAULT/log_file':value=>$log_file;
'DEFAULT/logging_context_format_string':
value => '%(asctime)s %(levelname)s %(name)s [%(request_id)s %(user_id)s %(project_id)s] %(instance)s %(message)s';
'DEFAULT/logging_default_format_string':
value => '%(asctime)s %(levelname)s %(name)s [-] %(instance)s %(message)s';
}
# might be used for stdout logging instead, if configured
if !defined(File["glance-logging.conf"]) {
file {"glance-logging.conf":
content => template('glance/logging.conf-nosyslog.erb'),
path => "/etc/glance/logging.conf",
}
}
}
@ -43,22 +77,6 @@ if $use_syslog {
Glance_registry_config<||> ~> Exec<| title == 'glance-manage db_sync' |>
Glance_registry_config<||> ~> Service['glance-registry']
File {
ensure => present,
owner => 'glance',
group => 'glance',
mode => '0640',
notify => Service['glance-registry'],
require => Class['glance']
}
if !defined(File["glance-logging.conf"]) {
file {"glance-logging.conf":
content => template('glance/logging.conf.erb'),
path => "/etc/glance/logging.conf",
}
}
if($sql_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
require 'mysql::python'
} elsif($sql_connection =~ /postgresql:\/\/\S+:\S+@\S+\/\S+/) {
@ -78,7 +96,6 @@ if $use_syslog {
'DEFAULT/backlog': value => "4096";
'DEFAULT/api_limit_max': value => "1000";
'DEFAULT/limit_param_default': value => "25";
'DEFAULT/use_syslog': value => $use_syslog;
}
# db connection config
@ -131,7 +148,7 @@ if $use_syslog {
{
package {'glance-registry':
name => $::glance::params::registry_package_name,
ensure => $package_ensure
ensure => $package_ensure
}
File['/etc/glance/glance-registry.conf'] -> Glance_registry_config<||>
Package['glance-registry']->Service['glance-registry']

View File

@ -0,0 +1,24 @@
[loggers]
keys = root
[handlers]
keys = root
[formatters]
keys = default
[formatter_default]
format=%(asctime)s %(levelname)s %(name)s:%(lineno)d %(message)s
[logger_root]
level=NOTSET
handlers = root
propagate = 1
[handler_root]
class = StreamHandler
level=NOTSET
formatter = default
args = (sys.stdout,)

View File

@ -1,18 +1,16 @@
[loggers]
keys = root
# devel is reserved for future usage
[handlers]
keys = production,devel
keys = production,devel,stderr
[formatters]
keys = normal,debug
[logger_root]
level = NOTSET
handlers = production
handlers = production,devel,stderr
propagate = 1
#qualname = glance
[formatter_debug]
format = glance-%(name)s %(levelname)s: %(module)s %(funcName)s %(message)s
@ -20,22 +18,46 @@ format = glance-%(name)s %(levelname)s: %(module)s %(funcName)s %(message)s
[formatter_normal]
format = glance-%(name)s %(levelname)s: %(message)s
# Extended logging info to LOG_<%= @syslog_log_facility %> with debug:<%= @debug %> and verbose:<%= @verbose %>
# Note: local copy goes to /var/log/glance-all.log
# logging info to LOG_<%= @syslog_log_facility %> with debug:<%= @debug %> and verbose:<%= @verbose %>
[handler_production]
class = handlers.SysLogHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = ('/dev/log', handlers.SysLogHandler.LOG_<%= @syslog_log_facility %>)
formatter = normal
# TODO find out how it could be usefull and how it should be used
[handler_stderr]
class = StreamHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = (sys.stderr,)
[handler_devel]
class = StreamHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = (sys.stdout,)

View File

@ -19,8 +19,7 @@
# Defaults to False.
# [use_syslog] Rather or not keystone should log to syslog. Optional.
# Defaults to False.
# [syslog_log_facility] Facility for syslog, if used. Optional. Note: duplicating conf option
# wouldn't have been used, but more powerfull rsyslog features managed via conf template instead
# [syslog_log_facility] Facility for syslog, if used. Optional.
# [syslog_log_level] logging level for non verbose and non debug mode. Optional.
# [catalog_type] Type of catalog that keystone uses to store endpoints,services. Optional.
# Defaults to sql. (Also accepts template)
@ -88,11 +87,16 @@ class keystone(
require => Package['keystone'],
}
if $use_syslog {
if $use_syslog and !$debug =~ /(?i)(true|yes)/ {
keystone_config {
'DEFAULT/log_config': value => "/etc/keystone/logging.conf";
'DEFAULT/log_file': ensure=> absent;
'DEFAULT/logdir': ensure=> absent;
'DEFAULT/log_dir': ensure=> absent;
'DEFAULT/logfile': ensure=> absent;
'DEFAULT/logdir': ensure=> absent;
'DEFAULT/use_stderr': ensure=> absent;
'DEFAULT/use_syslog': value => true;
'DEFAULT/syslog_log_facility': value => $syslog_log_facility;
}
file {"keystone-logging.conf":
content => template('keystone/logging.conf.erb'),
@ -103,9 +107,19 @@ class keystone(
}
} else {
keystone_config {
'DEFAULT/log_config': ensure => absent;
'DEFAULT/log_file': value => $log_file;
'DEFAULT/log_dir': value => $log_dir;
'DEFAULT/log_config': ensure=> absent;
'DEFAULT/use_syslog': ensure=> absent;
'DEFAULT/syslog_log_facility': ensure=> absent;
'DEFAULT/use_stderr': ensure=> absent;
'DEFAULT/log_dir':value=> $log_dir;
}
# might be used for stdout logging instead, if configured
file {"keystone-logging.conf":
content => template('keystone/logging.conf-nosyslog.erb'),
path => "/etc/keystone/logging.conf",
require => File['/etc/keystone'],
# We must notify service for new logging rules
notify => Service['keystone'],
}
}
@ -166,7 +180,6 @@ class keystone(
'DEFAULT/compute_port': value => $compute_port;
'DEFAULT/debug': value => $debug;
'DEFAULT/verbose': value => $verbose;
'DEFAULT/use_syslog': value => $use_syslog;
'identity/driver': value =>"keystone.identity.backends.sql.Identity";
'token/driver': value =>"keystone.token.backends.sql.Token";
'policy/driver': value =>"keystone.policy.backends.rules.Policy";

View File

@ -0,0 +1,24 @@
[loggers]
keys = root
[handlers]
keys = root
[formatters]
keys = default
[formatter_default]
format=%(asctime)s %(levelname)s %(name)s:%(lineno)d %(message)s
[logger_root]
level=NOTSET
handlers = root
propagate = 1
[handler_root]
class = StreamHandler
level=NOTSET
formatter = default
args = (sys.stdout,)

View File

@ -1,18 +1,16 @@
[loggers]
keys = root
# devel is reserved for future usage
[handlers]
keys = production,devel
keys = production,devel,stderr
[formatters]
keys = normal,debug
[logger_root]
level = NOTSET
handlers = production
handlers = production,devel,stderr
propagate = 1
#qualname = keystone
[formatter_debug]
format = keystone-%(name)s %(levelname)s: %(module)s %(funcName)s %(message)s
@ -20,22 +18,46 @@ format = keystone-%(name)s %(levelname)s: %(module)s %(funcName)s %(message)s
[formatter_normal]
format = keystone-%(name)s %(levelname)s: %(message)s
# Extended logging info to LOG_<%= @syslog_log_facility %> with debug:<%= @debug %> and verbose:<%= @verbose %>
# Note: local copy goes to /var/log/keystone-all.log
# logging info to LOG_<%= @syslog_log_facility %> with debug:<%= @debug %> and verbose:<%= @verbose %>
[handler_production]
class = handlers.SysLogHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = ('/dev/log', handlers.SysLogHandler.LOG_<%= @syslog_log_facility %>)
formatter = normal
# TODO find out how it could be usefull and how it should be used
[handler_stderr]
class = StreamHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = (sys.stderr,)
[handler_devel]
class = StreamHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = (sys.stdout,)

View File

@ -34,8 +34,7 @@
# $rabbit_nodes = ['node001', 'node002', 'node003']
# add rabbit nodes hostname
# [use_syslog] Rather or not service should log to syslog. Optional.
# [syslog_log_facility] Facility for syslog, if used. Optional. Note: duplicating conf option
# wouldn't have been used, but more powerfull rsyslog features managed via conf template instead
# [syslog_log_facility] Facility for syslog, if used. Optional.
# [syslog_log_level] logging level for non verbose and non debug mode. Optional.
#
class nova(
@ -162,20 +161,17 @@ class nova(
}
#Configure logging in nova.conf
if $use_syslog
if $use_syslog and !$debug =~ /(?i)(true|yes)/
{
nova_config
{
'DEFAULT/log_config': value => "/etc/nova/logging.conf";
'DEFAULT/log_file': ensure=> absent;
'DEFAULT/logdir': ensure=> absent;
'DEFAULT/use_syslog': value => "True";
'DEFAULT/logfile': ensure=> absent;
'DEFAULT/use_syslog': value => true;
'DEFAULT/use_stderr': ensure=> absent;
'DEFAULT/syslog_log_facility': value => $syslog_log_facility;
'DEFAULT/logging_context_format_string':
value => '%(levelname)s %(name)s [%(request_id)s %(user_id)s %(project_id)s] %(instance)s %(message)s';
'DEFAULT/logging_default_format_string':
value =>'%(levelname)s %(name)s [-] %(instance)s %(message)s';
}
file {"nova-logging.conf":
@ -183,6 +179,26 @@ file {"nova-logging.conf":
path => "/etc/nova/logging.conf",
require => File[$logdir],
}
}
else {
nova_config {
'DEFAULT/log_config': ensure=> absent;
'DEFAULT/use_syslog': ensure=> absent;
'DEFAULT/syslog_log_facility': ensure=> absent;
'DEFAULT/use_stderr': ensure=> absent;
'DEFAULT/logdir': value=> $logdir;
'DEFAULT/logging_context_format_string':
value => '%(asctime)s %(levelname)s %(name)s [%(request_id)s %(user_id)s %(project_id)s] %(instance)s %(message)s';
'DEFAULT/logging_default_format_string':
value => '%(asctime)s %(levelname)s %(name)s [-] %(instance)s %(message)s';
}
# might be used for stdout logging instead, if configured
file {"nova-logging.conf":
content => template('nova/logging.conf-nosyslog.erb'),
path => "/etc/nova/logging.conf",
require => File[$logdir],
}
}
# We must notify services to apply new logging rules
File['nova-logging.conf'] ~> Nova::Generic_service <| |>
@ -201,14 +217,6 @@ File['nova-logging.conf'] ~> Service <| title == "$nova::params::vncproxy_servic
File['nova-logging.conf'] ~> Service <| title == "$nova::params::volume_service_name" |>
File['nova-logging.conf'] ~> Service <| title == "$nova::params::meta_api_service_name" |>
}
else {
nova_config {
'DEFAULT/log_config': ensure=>absent;
'DEFAULT/use_syslog': value =>"False";
'DEFAULT/logdir': value => $logdir;
}
}
file { $logdir:
ensure => directory,
mode => '0751',

View File

@ -0,0 +1,24 @@
[loggers]
keys = root
[handlers]
keys = root
[formatters]
keys = default
[formatter_default]
format=%(asctime)s %(levelname)s %(name)s:%(lineno)d %(message)s
[logger_root]
level=NOTSET
handlers = root
propagate = 1
[handler_root]
class = StreamHandler
level=NOTSET
formatter = default
args = (sys.stdout,)

View File

@ -1,18 +1,16 @@
[loggers]
keys = root
# devel is reserved for future usage
[handlers]
keys = production,devel
keys = production,devel,stderr
[formatters]
keys = normal,debug
[logger_root]
level = NOTSET
handlers = production
handlers = production,devel,stderr
propagate = 1
#qualname = nova
[formatter_debug]
format = nova-%(name)s %(levelname)s: %(module)s %(funcName)s %(message)s
@ -20,22 +18,46 @@ format = nova-%(name)s %(levelname)s: %(module)s %(funcName)s %(message)s
[formatter_normal]
format = nova-%(name)s %(levelname)s: %(message)s
# Extended logging info to LOG_<%= @syslog_log_facility %> with debug:<%= @debug %> and verbose:<%= @verbose %>
# Note: local copy goes to /var/log/nova-all.log
# logging info to LOG_<%= @syslog_log_facility %> with debug:<%= @debug %> and verbose:<%= @verbose %>
[handler_production]
class = handlers.SysLogHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = ('/dev/log', handlers.SysLogHandler.LOG_<%= @syslog_log_facility %>)
formatter = normal
# TODO find out how it could be usefull and how it should be used
[handler_stderr]
class = StreamHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = (sys.stderr,)
[handler_devel]
class = StreamHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = (sys.stdout,)

View File

@ -381,6 +381,15 @@ $master_swift_proxy_ip = $master_swift_proxy_nodes[0]['internal_address']
### Glance and swift END ###
# This parameter specifies the verbosity level of log messages
# in openstack components config.
# Debug would have set DEBUG level and ignore verbose settings, if any.
# Verbose would have set INFO level messages
# In case of non debug and non verbose - WARNING, default level would have set.
# Note: if syslog on, this default level may be configured (for syslog) with syslog_log_level option.
$verbose = true
$debug = false
### Syslog ###
# Enable error messages reporting to rsyslog. Rsyslog must be installed in this case.
$use_syslog = true
@ -423,6 +432,7 @@ if $use_syslog {
# Rabbit doesn't support syslog directly, should be >= syslog_log_level,
# otherwise none rabbit's messages would have gone to syslog
rabbit_log_level => $syslog_log_level,
debug => $debug,
}
}
@ -473,15 +483,6 @@ $mirror_type = 'default'
$enable_test_repo = false
$repo_proxy = undef
# This parameter specifies the verbosity level of log messages
# in openstack components config.
# Debug would have set DEBUG level and ignore verbose settings, if any.
# Verbose would have set INFO level messages
# In case of non debug and non verbose - WARNING, default level would have set.
# Note: if syslog on, this default level may be configured (for syslog) with syslog_log_level option.
$verbose = true
$debug = false
#Rate Limits for cinder and Nova
#Cinder and Nova can rate-limit your requests to API services.
#These limits can be reduced for your installation or usage scenario.
@ -688,6 +689,8 @@ node /fuel-controller-[\d+]/ {
db_host => $internal_virtual_ip,
service_endpoint => $internal_virtual_ip,
cinder_rate_limits => $cinder_rate_limits,
debug => $debug,
verbose => $verbose,
syslog_log_level => $syslog_log_level,
syslog_log_facility_cinder => $syslog_log_facility_cinder,
}
@ -705,6 +708,9 @@ node /fuel-controller-[\d+]/ {
controller_node_address => $internal_virtual_ip,
swift_local_net_ip => $swift_local_net_ip,
master_swift_proxy_ip => $master_swift_proxy_ip,
debug => $debug,
verbose => $verbose,
syslog_log_level => $syslog_log_level,
}
Class ['openstack::swift::proxy'] -> Class['openstack::swift::storage_node']
@ -778,6 +784,7 @@ node /fuel-compute-[\d+]/ {
ssh_public_key => 'puppet:///ssh_keys/openstack.pub',
use_syslog => $use_syslog,
syslog_log_level => $syslog_log_level,
syslog_log_facility => $syslog_log_facility_nova,
syslog_log_facility_quantum => $syslog_log_facility_quantum,
syslog_log_facility_cinder => $syslog_log_facility_cinder,
nova_rate_limits => $nova_rate_limits,

View File

@ -420,6 +420,15 @@ $master_swift_proxy_ip = $master_swift_proxy_nodes[0]['internal_address']
### Glance and swift END ###
# This parameter specifies the verbosity level of log messages
# in openstack components config.
# Debug would have set DEBUG level and ignore verbose settings, if any.
# Verbose would have set INFO level messages
# In case of non debug and non verbose - WARNING, default level would have set.
# Note: if syslog on, this default level may be configured (for syslog) with syslog_log_level option.
$verbose = true
$debug = false
### Syslog ###
# Enable error messages reporting to rsyslog. Rsyslog must be installed in this case.
$use_syslog = true
@ -462,6 +471,7 @@ if $use_syslog {
# Rabbit doesn't support syslog directly, should be >= syslog_log_level,
# otherwise none rabbit's messages would have gone to syslog
rabbit_log_level => $syslog_log_level,
debug => $debug,
}
}
@ -512,15 +522,6 @@ $mirror_type = 'default'
$enable_test_repo = false
$repo_proxy = undef
# This parameter specifies the verbosity level of log messages
# in openstack components config.
# Debug would have set DEBUG level and ignore verbose settings, if any.
# Verbose would have set INFO level messages
# In case of non debug and non verbose - WARNING, default level would have set.
# Note: if syslog on, this default level may be configured (for syslog) with syslog_log_level option.
$verbose = true
$debug = true
#Rate Limits for cinder and Nova
#Cinder and Nova can rate-limit your requests to API services.
#These limits can be reduced for your installation or usage scenario.
@ -761,6 +762,8 @@ node /fuel-controller-[\d+]/ {
rabbit_password => $rabbit_password,
rabbit_user => $rabbit_user,
rabbit_ha_virtual_ip => $internal_virtual_ip,
debug => $debug,
verbose => $verbose,
syslog_log_level => $syslog_log_level,
syslog_log_facility_cinder => $syslog_log_facility_cinder,
qpid_nodes => [$internal_virtual_ip],
@ -781,6 +784,9 @@ node /fuel-controller-[\d+]/ {
controller_node_address => $internal_virtual_ip,
swift_local_net_ip => $swift_local_net_ip,
master_swift_proxy_ip => $master_swift_proxy_ip,
debug => $debug,
verbose => $verbose,
syslog_log_level => $syslog_log_level,
}
Class ['openstack::swift::proxy'] -> Class['openstack::swift::storage_node']
@ -857,6 +863,7 @@ node /fuel-compute-[\d+]/ {
ssh_public_key => 'puppet:///ssh_keys/openstack.pub',
use_syslog => $use_syslog,
syslog_log_level => $syslog_log_level,
syslog_log_facility => $syslog_log_facility_nova,
syslog_log_facility_quantum => $syslog_log_facility_quantum,
syslog_log_facility_cinder => $syslog_log_facility_cinder,
nova_rate_limits => $nova_rate_limits,

View File

@ -443,6 +443,15 @@ $master_swift_proxy_ip = $master_swift_proxy_nodes[0]['internal_address']
### Glance and swift END ###
# This parameter specifies the verbosity level of log messages
# in openstack components config.
# Debug would have set DEBUG level and ignore verbose settings, if any.
# Verbose would have set INFO level messages
# In case of non debug and non verbose - WARNING, default level would have set.
# Note: if syslog on, this default level may be configured (for syslog) with syslog_log_level option.
$verbose = true
$debug = false
### Syslog ###
# Enable error messages reporting to rsyslog. Rsyslog must be installed in this case.
$use_syslog = true
@ -485,6 +494,7 @@ if $use_syslog {
# Rabbit doesn't support syslog directly, should be >= syslog_log_level,
# otherwise none rabbit's messages would have gone to syslog
rabbit_log_level => $syslog_log_level,
debug => $debug,
}
}
@ -535,15 +545,6 @@ $mirror_type = 'default'
$enable_test_repo = false
$repo_proxy = undef
# This parameter specifies the verbosity level of log messages
# in openstack components config.
# Debug would have set DEBUG level and ignore verbose settings, if any.
# Verbose would have set INFO level messages
# In case of non debug and non verbose - WARNING, default level would have set.
# Note: if syslog on, this default level may be configured (for syslog) with syslog_log_level option.
$verbose = true
$debug = false
#Rate Limits for cinder and Nova
#Cinder and Nova can rate-limit your requests to API services.
#These limits can be reduced for your installation or usage scenario.
@ -833,6 +834,7 @@ node /fuel-compute-[\d+]/ {
ssh_public_key => 'puppet:///ssh_keys/openstack.pub',
use_syslog => $use_syslog,
syslog_log_level => $syslog_log_level,
syslog_log_facility => $syslog_log_facility_nova,
syslog_log_facility_quantum => $syslog_log_facility_quantum,
syslog_log_facility_cinder => $syslog_log_facility_cinder,
nova_rate_limits => $nova_rate_limits,
@ -888,7 +890,9 @@ node /fuel-swift-[\d+]/ {
qpid_user => $rabbit_user,
qpid_nodes => [$internal_virtual_ip],
sync_rings => ! $primary_proxy,
syslog_log_level => $syslog_log_level,
debug => $debug,
verbose => $verbose,
syslog_log_level => $syslog_log_level,
syslog_log_facility_cinder => $syslog_log_facility_cinder,
}
@ -931,6 +935,9 @@ node /fuel-swiftproxy-[\d+]/ {
controller_node_address => $internal_virtual_ip,
swift_local_net_ip => $swift_local_net_ip,
master_swift_proxy_ip => $master_swift_proxy_ip,
debug => $debug,
verbose => $verbose,
syslog_log_level => $syslog_log_level,
}
}

View File

@ -382,6 +382,14 @@ if $node[0]['role'] == 'primary-controller' {
$primary_controller = false
}
# This parameter specifies the verbosity level of log messages
# in openstack components config.
# Debug would have set DEBUG level and ignore verbose settings, if any.
# Verbose would have set INFO level messages
# In case of non debug and non verbose - WARNING, default level would have set.
# Note: if syslog on, this default level may be configured (for syslog) with syslog_log_level option.
$verbose = true
$debug = false
### Syslog ###
# Enable error messages reporting to rsyslog. Rsyslog must be installed in this case.
@ -425,6 +433,7 @@ if $use_syslog {
# Rabbit doesn't support syslog directly, should be >= syslog_log_level,
# otherwise none rabbit's messages would have gone to syslog
rabbit_log_level => $syslog_log_level,
debug => $debug,
}
}
@ -475,15 +484,6 @@ $mirror_type = 'default'
$enable_test_repo = false
$repo_proxy = undef
# This parameter specifies the verbosity level of log messages
# in openstack components config.
# Debug would have set DEBUG level and ignore verbose settings, if any.
# Verbose would have set INFO level messages
# In case of non debug and non verbose - WARNING, default level would have set.
# Note: if syslog on, this default level may be configured (for syslog) with syslog_log_level option.
$verbose = true
$debug = true
#Rate Limits for cinder and Nova
#Cinder and Nova can rate-limit your requests to API services.
#These limits can be reduced for your installation or usage scenario.

View File

@ -322,6 +322,15 @@ $swift_loopback = false
### Glance and swift END ###
# This parameter specifies the verbosity level of log messages
# in openstack components config.
# Debug would have set DEBUG level and ignore verbose settings, if any.
# Verbose would have set INFO level messages
# In case of non debug and non verbose - WARNING, default level would have set.
# Note: if syslog on, this default level may be configured (for syslog) with syslog_log_level option.
$verbose = true
$debug = false
### Syslog ###
# Enable error messages reporting to rsyslog. Rsyslog must be installed in this case,
# and configured to start at the very beginning of puppet agent run.
@ -365,6 +374,7 @@ if $use_syslog {
# Rabbit doesn't support syslog directly, should be >= syslog_log_level,
# otherwise none rabbit's messages would have gone to syslog
rabbit_log_level => $syslog_log_level,
debug => $debug,
}
}
@ -415,15 +425,6 @@ $enable_test_repo = false
$repo_proxy = undef
$use_upstream_mysql = true
# This parameter specifies the verbosity level of log messages
# in openstack components config.
# Debug would have set DEBUG level and ignore verbose settings, if any.
# Verbose would have set INFO level messages
# In case of non debug and non verbose - WARNING, default level would have set.
# Note: if syslog on, this default level may be configured (for syslog) with syslog_log_level option.
$verbose = true
$debug = true
#Rate Limits for cinder and Nova
#Cinder and Nova can rate-limit your requests to API services.
#These limits can be reduced for your installation or usage scenario.
@ -706,6 +707,7 @@ node /fuel-compute-[\d+]/ {
cinder_iscsi_bind_addr => $cinder_iscsi_bind_addr,
use_syslog => $use_syslog,
syslog_log_level => $syslog_log_level,
syslog_log_facility => $syslog_log_facility_nova,
syslog_log_facility_quantum => $syslog_log_facility_quantum,
syslog_log_facility_cinder => $syslog_log_facility_cinder,
nova_rate_limits => $nova_rate_limits,

View File

@ -287,6 +287,15 @@ $swift_loopback = false
### Glance and swift END ###
# This parameter specifies the verbosity level of log messages
# in openstack components config.
# Debug would have set DEBUG level and ignore verbose settings, if any.
# Verbose would have set INFO level messages
# In case of non debug and non verbose - WARNING, default level would have set.
# Note: if syslog on, this default level may be configured (for syslog) with syslog_log_level option.
$verbose = true
$debug = false
### Syslog ###
# Enable error messages reporting to rsyslog. Rsyslog must be installed in this case,
# and configured to start at the very beginning of puppet agent run.
@ -330,6 +339,7 @@ if $use_syslog {
# Rabbit doesn't support syslog directly, should be >= syslog_log_level,
# otherwise none rabbit's messages would have gone to syslog
rabbit_log_level => $syslog_log_level,
debug => $debug,
}
}
@ -380,15 +390,6 @@ $enable_test_repo = false
$repo_proxy = undef
$use_upstream_mysql = true
# This parameter specifies the verbosity level of log messages
# in openstack components config.
# Debug would have set DEBUG level and ignore verbose settings, if any.
# Verbose would have set INFO level messages
# In case of non debug and non verbose - WARNING, default level would have set.
# Note: if syslog on, this default level may be configured (for syslog) with syslog_log_level option.
$verbose = true
$debug = false
#Rate Limits for cinder and Nova
#Cinder and Nova can rate-limit your requests to API services.
#These limits can be reduced for your installation or usage scenario.

View File

@ -18,6 +18,7 @@
# [virtual] if node is virtual, fix for udp checksums should be applied
# [rabbit_log_level] should be >= global syslog_log_level option,
# otherwise none messages would have gone to syslog (client role only)
# [debug] switch between debug and standard cases, client role only. imfile monitors for local logs would be used if debug.
class openstack::logging (
$role = 'client',
@ -38,6 +39,7 @@ class openstack::logging (
$syslog_log_facility_nova = 'LOCAL6',
$syslog_log_facility_keystone = 'LOCAL7',
$rabbit_log_level = 'NOTICE',
$debug = false,
) {
validate_re($proto, 'tcp|udp')
@ -58,6 +60,7 @@ if $role == 'client' {
syslog_log_facility_nova => $syslog_log_facility_nova,
syslog_log_facility_keystone => $syslog_log_facility_keystone,
log_level => $rabbit_log_level,
debug => $debug,
}
} else { # server

View File

@ -179,12 +179,13 @@ class openstack::nova::controller (
image_service => 'nova.image.glance.GlanceImageService',
glance_api_servers => $glance_connection,
verbose => $verbose,
debug => $debug,
rabbit_nodes => $rabbit_nodes,
ensure_package => $ensure_package,
api_bind_address => $api_bind_address,
use_syslog => $use_syslog,
syslog_log_facility => $syslog_log_facility,
syslog_log_level => $syslog_log_level,
syslog_log_facility => $syslog_log_facility,
syslog_log_level => $syslog_log_level,
rabbit_ha_virtual_ip => $rabbit_ha_virtual_ip,
}
} else {
@ -195,11 +196,12 @@ class openstack::nova::controller (
image_service => 'nova.image.glance.GlanceImageService',
glance_api_servers => $glance_connection,
verbose => $verbose,
debug => $debug,
rabbit_host => $rabbit_connection,
ensure_package => $ensure_package,
api_bind_address => $api_bind_address,
syslog_log_facility => $syslog_log_facility,
syslog_log_level => $syslog_log_level,
syslog_log_facility => $syslog_log_facility,
syslog_log_level => $syslog_log_level,
use_syslog => $use_syslog,
}
}
@ -214,10 +216,11 @@ class openstack::nova::controller (
image_service => 'nova.image.glance.GlanceImageService',
glance_api_servers => $glance_connection,
verbose => $verbose,
debug => $debug,
ensure_package => $ensure_package,
api_bind_address => $api_bind_address,
syslog_log_facility => $syslog_log_facility,
syslog_log_level => $syslog_log_level,
syslog_log_facility => $syslog_log_facility,
syslog_log_level => $syslog_log_level,
use_syslog => $use_syslog,
}
}
@ -326,7 +329,7 @@ class openstack::nova::controller (
}
# Do not enable it!!!!!
# metadata service provides by nova api
# metadata service provides by nova api
# while enabled_apis=ec2,osapi_compute,metadata
# and by quantum-metadata-agent on network node as proxy
#

View File

@ -37,6 +37,9 @@ class openstack::swift::proxy (
$master_swift_proxy_ip = undef,
$collect_exported = false,
$rings = ['account', 'object', 'container'],
$debug = false,
$verbose = true,
$syslog_log_level = 'WARNING',
) {
if !defined(Class['swift']) {
class { 'swift':
@ -57,6 +60,9 @@ class openstack::swift::proxy (
allow_account_management => $proxy_allow_account_management,
account_autocreate => $proxy_account_autocreate,
package_ensure => $package_ensure,
debug => $debug,
verbose => $verbose,
syslog_log_level => $syslog_log_level,
}
# configure all of the middlewares

View File

@ -33,7 +33,9 @@ class openstack::swift::storage_node (
$service_endpoint = '127.0.0.1',
$use_syslog = false,
$syslog_log_facility_cinder = 'LOCAL3',
$syslog_log_level = 'WARNING',
$syslog_log_level = 'WARNING',
$debug = false,
$verbose = true,
# Rabbit details necessary for cinder
$rabbit_nodes = false,
$rabbit_password = 'rabbit_pw',
@ -68,6 +70,9 @@ class openstack::swift::storage_node (
devices => $storage_mnt_base_dir,
devices_dirs => $storage_devices,
swift_zone => $swift_zone,
debug => $debug,
verbose => $verbose,
syslog_log_level => $syslog_log_level,
}
validate_string($master_swift_proxy_ip)

View File

@ -1,5 +1,5 @@
"/var/log/*-all.log" "/var/log/remote/*/*log"
"/var/log/kern.log" "/var/log/debug" "/var/log/daemon.log"
"/var/log/*-all.log" "/var/log/corosync.log" "/var/log/remote/*/*log"
"/var/log/kern.log" "/var/log/debug" "/var/log/syslog" "/var/log/daemon.log"
"/var/log/auth.log" "/var/log/user.log" "var/log/mail.log"
"/var/log/cron.log" "/var/log/dashboard.log" "/var/log/ha.log"
{

View File

@ -1,6 +1,8 @@
"/var/log/*-all.log" "/var/log/remote/*/*log"
"/var/log/*-all.log" "/var/log/corosync.log" "/var/log/remote/*/*log"
"/var/log/kern.log" "/var/log/debug" "/var/log/syslog"
"/var/log/dashboard.log" "/var/log/ha.log" "/var/log/quantum/*.log"
"/var/log/nova/*.log" "/var/log/keystone/*.log" "/var/log/glance/*.log"
"/var/log/cinder/*.log"
# This file is used for hourly log rotations, use (min)size options here
{
sharedscripts
@ -8,7 +10,7 @@
copytruncate
# rotate only if 30M size or bigger
minsize 30M
# also rotate if 300M size have exceeded, should be size > minsize
# also rotate if <%= @limitsize %> size have exceeded, should be size > minsize
size <%= @limitsize %>
# keep logs for <%= @keep %> rotations
rotate <%= @keep %>

View File

@ -52,6 +52,14 @@ if $nodes != undef {
}
}
# This parameter specifies the verbosity level of log messages
# in openstack components config.
# Debug would have set DEBUG level and ignore verbose settings, if any.
# Verbose would have set INFO level messages
# In case of non debug and non verbose - WARNING, default level would have set.
# Note: if syslog on, this default level may be configured (for syslog) with syslog_log_level option.
$verbose = true
$debug = false
### Syslog ###
# Enable error messages reporting to rsyslog. Rsyslog must be installed in this case.
@ -126,7 +134,7 @@ class node_netconfig (
}
case $::operatingsystem {
'redhat' : {
'redhat' : {
$queue_provider = 'qpid'
$custom_mysql_setup_class = 'pacemaker_mysql'
}
@ -185,7 +193,7 @@ class os_common {
# should be > 30M
limitsize => '300M',
# remote servers to send logs to
rservers => $rservers,
rservers => $rservers,
# should be true, if client is running at virtual node
virtual => true,
# facilities
@ -197,16 +205,18 @@ class os_common {
# Rabbit doesn't support syslog directly, should be >= syslog_log_level,
# otherwise none rabbit's messages would have gone to syslog
rabbit_log_level => $syslog_log_level,
# debug mode
debug => $debug ? { 'true' => true, true => true, default=> false },
}
}
#case $role {
# /controller/: { $hostgroup = 'controller' }
# /controller/: { $hostgroup = 'controller' }
# /swift-proxy/: { $hostgroup = 'swift-proxy' }
# /storage/:{ $hostgroup = 'swift-storage' }
# /compute/: { $hostgroup = 'compute' }
# /cinder/: { $hostgroup = 'cinder' }
# default: { $hostgroup = 'generic' }
# default: { $hostgroup = 'generic' }
#}
# if $nagios != 'false' {
@ -236,11 +246,11 @@ class os_common {
node default {
case $deployment_mode {
"singlenode": {
include "osnailyfacter::cluster_simple"
"singlenode": {
include "osnailyfacter::cluster_simple"
class {'os_common':}
}
"multinode": {
"multinode": {
include osnailyfacter::cluster_simple
class {'os_common':}
}

View File

@ -8,7 +8,7 @@ if $quantum == 'true'
{
$quantum_hash = parsejson($::quantum_access)
$quantum_params = parsejson($::quantum_parameters)
$novanetwork_params = {}
$novanetwork_params = {}
}
else
@ -140,14 +140,14 @@ $network_config = {
if !$verbose
if !$verbose
{
$verbose = 'true'
$verbose = 'false'
}
if !$debug
{
$debug = 'true'
$debug = 'false'
}
@ -173,7 +173,7 @@ $multi_host = true
$manage_volumes = false
$glance_backend = 'swift'
$quantum_netnode_on_cnt = true
$swift_loopback = false
$swift_loopback = false
$mirror_type = 'external'
Exec { logoutput => true }
@ -183,7 +183,7 @@ Exec { logoutput => true }
class compact_controller (
$quantum_network_node = $quantum_netnode_on_cnt
) {
class {'osnailyfacter::tinyproxy': }
class { 'openstack::controller_ha':
controller_public_addresses => $controller_public_addresses,
@ -202,8 +202,8 @@ class compact_controller (
num_networks => $num_networks,
network_size => $network_size,
network_config => $network_config,
verbose => $verbose,
debug => $debug,
debug => $debug ? { 'true' => true, true => true, default=> false },
verbose => $verbose ? { 'true' => true, true => true, default=> false },
queue_provider => $::queue_provider,
qpid_password => $rabbit_hash[password],
qpid_user => $rabbit_hash[user],
@ -306,7 +306,10 @@ class virtual_ips () {
swift_zone => $swift_zone,
swift_local_net_ip => $storage_address,
master_swift_proxy_ip => $master_swift_proxy_ip,
sync_rings => ! $primary_proxy
sync_rings => ! $primary_proxy,
syslog_log_level => $syslog_log_level,
debug => $debug ? { 'true' => true, true => true, default=> false },
verbose => $verbose ? { 'true' => true, true => true, default=> false },
}
if $primary_proxy {
ring_devices {'all': storages => $controllers }
@ -317,7 +320,10 @@ class virtual_ips () {
primary_proxy => $primary_proxy,
controller_node_address => $management_vip,
swift_local_net_ip => $swift_local_net_ip,
master_swift_proxy_ip => $master_swift_proxy_ip
master_swift_proxy_ip => $master_swift_proxy_ip,
syslog_log_level => $syslog_log_level,
debug => $debug ? { 'true' => true, true => true, default=> false },
verbose => $verbose ? { 'true' => true, true => true, default=> false },
}
#TODO: PUT this configuration stanza into nova class
nova_config { 'DEFAULT/start_guests_on_host_boot': value => $start_guests_on_host_boot }
@ -337,7 +343,7 @@ class virtual_ips () {
Class[openstack::swift::storage_node] -> Class[openstack::img::cirros]
Class[openstack::swift::proxy] -> Class[openstack::img::cirros]
Service[swift-proxy] -> Class[openstack::img::cirros]
}
if !$quantum
{
@ -351,7 +357,7 @@ class virtual_ips () {
auth_url => "http://${management_vip}:5000/v2.0/",
authtenant_name => $access_hash[tenant],
}
}
}
}
@ -379,8 +385,8 @@ class virtual_ips () {
auto_assign_floating_ip => $bool_auto_assign_floating_ip,
glance_api_servers => "${management_vip}:9292",
vncproxy_host => $public_vip,
verbose => $verbose,
debug => $debug,
debug => $debug ? { 'true' => true, true => true, default=> false },
verbose => $verbose ? { 'true' => true, true => true, default=> false },
cinder_volume_group => "cinder",
vnc_enabled => true,
manage_volumes => $cinder ? { false => $manage_volumes, default =>$is_cinder_node },
@ -400,6 +406,7 @@ class virtual_ips () {
segment_range => $segment_range,
use_syslog => true,
syslog_log_level => $syslog_log_level,
syslog_log_facility => $syslog_log_facility_nova,
syslog_log_facility_quantum => $syslog_log_facility_quantum,
syslog_log_facility_cinder => $syslog_log_facility_cinder,
nova_rate_limits => $nova_rate_limits,
@ -440,8 +447,8 @@ class virtual_ips () {
cinder_user_password => $cinder_hash[user_password],
syslog_log_facility => $syslog_log_facility_cinder,
syslog_log_level => $syslog_log_level,
debug => $debug ? { 'true' => 'True', default=>'False' },
verbose => $verbose ? { 'false' => 'False', default=>'True' },
debug => $debug ? { 'true' => true, true => true, default=> false },
verbose => $verbose ? { 'true' => true, true => true, default=> false },
use_syslog => true,
}
# class { "::rsyslog::client":

View File

@ -8,7 +8,7 @@ if $quantum == 'true'
{
$quantum_hash = parsejson($::quantum_access)
$quantum_params = parsejson($::quantum_parameters)
$novanetwork_params = {}
$novanetwork_params = {}
}
else
{
@ -62,14 +62,14 @@ if !$rabbit_hash[user]
$rabbit_user = $rabbit_hash['user']
if !$verbose
if !$verbose
{
$verbose = 'true'
$verbose = 'false'
}
if !$debug
{
$debug = 'true'
$debug = 'false'
}
if !$swift_partition
@ -211,8 +211,8 @@ class ha_controller (
num_networks => $num_networks,
network_size => $network_size,
network_config => $network_config,
verbose => $verbose,
debug => $debug,
debug => $debug ? { 'true' => true, true => true, default=> false },
verbose => $verbose ? { 'true' => true, true => true, default=> false },
auto_assign_floating_ip => $bool_auto_assign_floating_ip,
mysql_root_password => $mysql_hash[root_password],
admin_email => $access_hash[email],
@ -335,8 +335,8 @@ case $role {
qpid_nodes => [$management_vip],
glance_api_servers => "${management_vip}:9292",
vncproxy_host => $public_vip,
verbose => $verbose,
debug => $debug,
debug => $debug ? { 'true' => true, true => true, default=> false },
verbose => $verbose ? { 'true' => true, true => true, default=> false },
vnc_enabled => true,
nova_user_password => $nova_hash[user_password],
cache_server_ip => $controller_nodes,
@ -355,6 +355,7 @@ case $role {
cinder_rate_limits => $::cinder_rate_limits,
use_syslog => $use_syslog,
syslog_log_level => $syslog_log_level,
syslog_log_facility => $syslog_log_facility_nova,
syslog_log_facility_quantum => $syslog_log_facility_quantum,
syslog_log_facility_cinder => $syslog_log_facility_cinder,
nova_rate_limits => $::nova_rate_limits,
@ -394,7 +395,9 @@ case $role {
qpid_user => $rabbit_hash[user],
qpid_nodes => [$management_vip],
sync_rings => ! $primary_proxy,
syslog_log_level => $syslog_log_level,
syslog_log_level => $syslog_log_level,
debug => $debug ? { 'true' => true, true => true, default=> false },
verbose => $verbose ? { 'true' => true, true => true, default=> false },
syslog_log_facility_cinder => $syslog_log_facility_cinder,
}
@ -419,6 +422,9 @@ case $role {
controller_node_address => $management_vip,
swift_local_net_ip => $swift_local_net_ip,
master_swift_proxy_ip => $master_swift_proxy_ip,
syslog_log_level => $syslog_log_level,
debug => $debug ? { 'true' => true, true => true, default=> false },
verbose => $verbose ? { 'true' => true, true => true, default=> false },
}
}
@ -440,8 +446,8 @@ case $role {
auth_host => $management_vip,
iscsi_bind_host => $storage_address,
cinder_user_password => $cinder_hash[user_password],
debug => $debug ? { 'true' => 'True', default=>'False' },
verbose => $verbose ? { 'false' => 'False', default=>'True' },
debug => $debug ? { 'true' => true, true => true, default=> false },
verbose => $verbose ? { 'true' => true, true => true, default=> false },
syslog_log_facility => $syslog_log_facility_cinder,
syslog_log_level => $syslog_log_level,
use_syslog => true,

View File

@ -5,7 +5,7 @@ if $quantum == 'true'
{
$quantum_hash = parsejson($::quantum_access)
$quantum_params = parsejson($::quantum_parameters)
$novanetwork_params = {}
$novanetwork_params = {}
}
else
@ -103,18 +103,16 @@ $quantum_sql_connection = "mysql://${quantum_db_user}:${quantum_db_password}@${
$quantum_metadata_proxy_shared_secret = $quantum_params['metadata_proxy_shared_secret']
$quantum_gre_bind_addr = $::internal_address
if !$verbose
if !$verbose
{
$verbose = 'true'
$verbose = 'false'
}
if !$debug
{
$debug = 'true'
$debug = 'false'
}
case $role {
"controller" : {
include osnailyfacter::test_controller
@ -133,8 +131,8 @@ if !$debug
num_networks => $num_networks,
network_size => $network_size,
network_config => $network_config,
verbose => $verbose,
debug => $debug,
debug => $debug ? { 'true' => true, true => true, default=> false },
verbose => $verbose ? { 'true' => true, true => true, default=> false },
auto_assign_floating_ip => $bool_auto_assign_floating_ip,
mysql_root_password => $mysql_hash[root_password],
admin_email => $access_hash[email],
@ -194,8 +192,8 @@ if !$debug
floating_range => $floating_hash,
fixed_range => $fixed_network_range,
create_networks => $create_networks,
verbose => $verbose,
debug => $debug,
debug => $debug ? { 'true' => true, true => true, default=> false },
verbose => $verbose ? { 'true' => true, true => true, default=> false },
queue_provider => $queue_provider,
rabbit_password => $rabbit_hash[password],
rabbit_user => $rabbit_hash[user],
@ -304,10 +302,11 @@ if !$debug
cinder_volume_group => "cinder",
manage_volumes => $cinder ? { false => $manage_volumes, default =>$is_cinder_node },
db_host => $controller_node_address,
verbose => $verbose,
debug => $debug,
debug => $debug ? { 'true' => true, true => true, default=> false },
verbose => $verbose ? { 'true' => true, true => true, default=> false },
use_syslog => true,
syslog_log_level => $syslog_log_level,
syslog_log_facility => $syslog_log_facility_nova,
syslog_log_facility_quantum => $syslog_log_facility_quantum,
syslog_log_facility_cinder => $syslog_log_facility_cinder,
state_path => $nova_hash[state_path],
@ -342,8 +341,8 @@ if !$debug
cinder_user_password => $cinder_hash[user_password],
syslog_log_facility => $syslog_log_facility_cinder,
syslog_log_level => $syslog_log_level,
debug => $debug ? { 'true' => 'True', default=>'False' },
verbose => $verbose ? { 'false' => 'False', default=>'True' },
debug => $debug ? { 'true' => true, true => true, default=> false },
verbose => $verbose ? { 'true' => true, true => true, default=> false },
use_syslog => true,
}
}

View File

@ -316,22 +316,25 @@ quantum_l3_agent_start() {
fi
clean_up
if ocf_is_true ${OCF_RESKEY_syslog} ; then
L3_SYSLOG=" | logger -t quantum-quantum.agent.l3 "
if ocf_is_true ${OCF_RESKEY_debug} ; then
L3_LOG=" | tee -ia /var/log/quantum/l3.log "
else
L3_LOG=" "
fi
else
L3_SYSLOG=""
if ocf_is_true ${OCF_RESKEY_debug} ; then
L3_LOG=" >> /var/log/quantum/l3.log "
else
L3_LOG=" >> /dev/null "
fi
fi
# FIXME stderr should not be used unless quantum+agents init & OCF would reditect to stderr
# if ocf_is_true ${OCF_RESKEY_syslog} ; then
# Disable logger because we use imfile for log files grabbing to rsyslog
# L3_SYSLOG=" | logger -t quantum-quantum.agent.l3 "
# if ocf_is_true ${OCF_RESKEY_debug} ; then
# L3_LOG=" | tee -ia /var/log/quantum/l3.log "
# else
# L3_LOG=" "
# fi
# else
# L3_SYSLOG=""
# if ocf_is_true ${OCF_RESKEY_debug} ; then
# L3_LOG=" >> /var/log/quantum/l3.log "
# else
# L3_LOG=" >> /dev/null "
# fi
# fi
L3_SYSLOG=""
L3_LOG=" > /dev/null "
# run the actual quantum-l3-agent daemon. Don't use ocf_run as we're sending the tool's output
# straight to /dev/null anyway and using ocf_run would break stdout-redirection here.

View File

@ -1,7 +1,6 @@
#
# [use_syslog] Rather or not service should log to syslog. Optional.
# [syslog_log_facility] Facility for syslog, if used. Optional. Note: duplicating conf option
# wouldn't have been used, but more powerfull rsyslog features managed via conf template instead
# [syslog_log_facility] Facility for syslog, if used. Optional.
# [syslog_log_level] logging level for non verbose and non debug mode. Optional.
#
class quantum (
@ -39,6 +38,7 @@ class quantum (
$auth_tenant = 'services',
$auth_user = 'quantum',
$log_file = '/var/log/quantum/server.log',
$log_dir = '/var/log/quantum',
$use_syslog = false,
$syslog_log_facility = 'LOCAL4',
$syslog_log_level = 'WARNING',
@ -71,7 +71,7 @@ class quantum (
owner => root,
group => root,
source => "puppet:///modules/quantum/q-agent-cleanup.py",
}
}
file {'quantum-root':
path => '/etc/sudoers.d/quantum-root',
@ -168,14 +168,27 @@ class quantum (
}
# logging for agents grabbing from stderr. It's workarround for bug in quantum-logging
# server givs this parameters from command line
# FIXME change init.d scripts for q&agents, fix daemon launch commands (CENTOS/RHEL):
# quantum-server:
# daemon --user quantum --pidfile $pidfile "$exec --config-file $config --config-file /etc/$prog/plugin.ini &>>/var/log/quantum/server.log & echo \$!
# quantum-ovs-cleanup:
# daemon --user quantum $exec --config-file /etc/$proj/$proj.conf --config-file $config &>>/var/log/$proj/$plugin.log
# quantum-ovs/metadata/l3/dhcp/-agents:
# daemon --user quantum --pidfile $pidfile "$exec --config-file /etc/$proj/$proj.conf --config-file $config &>>/var/log/$proj/$plugin.log & echo \$! > $pidfile"
quantum_config {
'DEFAULT/log_config': ensure=> absent;
'DEFAULT/log_file': ensure=> absent;
'DEFAULT/log_dir': ensure=> absent;
'DEFAULT/use_syslog': ensure=> absent;
'DEFAULT/use_stderr': value => true;
'DEFAULT/logfile': ensure=> absent;
}
if $use_syslog {
if $use_syslog and !$debug =~ /(?i)(true|yes)/ {
quantum_config {
'DEFAULT/log_dir': ensure=> absent;
'DEFAULT/logdir': ensure=> absent;
'DEFAULT/log_config': value => "/etc/quantum/logging.conf";
'DEFAULT/use_stderr': ensure=> absent;
'DEFAULT/use_syslog': value=> true;
'DEFAULT/syslog_log_facility': value=> $syslog_log_facility;
}
file { "quantum-logging.conf":
content => template('quantum/logging.conf.erb'),
path => "/etc/quantum/logging.conf",
@ -183,23 +196,30 @@ class quantum (
group => "quantum",
mode => 640,
}
# We must setup logging before start services under pacemaker
File['quantum-logging.conf'] -> Service<| title == 'quantum-server' |>
File['quantum-logging.conf'] -> Anchor<| title == 'quantum-ovs-agent' |>
File['quantum-logging.conf'] -> Anchor<| title == 'quantum-l3' |>
File['quantum-logging.conf'] -> Anchor<| title == 'quantum-dhcp-agent' |>
} else {
quantum_config {
# logging for agents grabbing from stderr. It's workarround for bug in quantum-logging
'DEFAULT/use_syslog': ensure=> absent;
'DEFAULT/syslog_log_facility': ensure=> absent;
'DEFAULT/log_config': ensure=> absent;
# FIXME stderr should not be used unless quantum+agents init & OCF scripts would be fixed to redirect its output to stderr!
#'DEFAULT/use_stderr': value => true;
'DEFAULT/use_stderr': ensure=> absent;
'DEFAULT/log_dir': value => $log_dir;
}
file { "quantum-logging.conf":
content => template('quantum/logging.conf-nosyslog.erb'),
path => "/etc/quantum/logging.conf",
owner => "root",
group => "root",
mode => 644,
group => "quantum",
mode => 640,
}
}
# We must setup logging before start services under pacemaker
File['quantum-logging.conf'] -> Service<| title == "$::quantum::params::server_service" |>
File['quantum-logging.conf'] -> Anchor<| title == 'quantum-ovs-agent' |>
File['quantum-logging.conf'] -> Anchor<| title == 'quantum-l3' |>
File['quantum-logging.conf'] -> Anchor<| title == 'quantum-dhcp-agent' |>
File <| title=='/etc/quantum' |> -> File <| title=='quantum-logging.conf' |>
if defined(Anchor['quantum-server-config-done']) {
@ -208,8 +228,16 @@ class quantum (
$endpoint_quantum_main_configuration = 'quantum-init-done'
}
# FIXME Workaround for FUEL-842: remove explicit --log-config from init scripts cuz it breaks logging!
# FIXME this hack should be deleted after FUEL-842 have resolved
exec {'init-dirty-hack':
command => "sed -i 's/\-\-log\-config=\$loggingconf//g' /etc/init.d/quantum-*",
path => ["/sbin", "/bin", "/usr/sbin", "/usr/bin"],
}
Anchor['quantum-init'] ->
Package['quantum'] ->
Exec['init-dirty-hack'] ->
File['/var/cache/quantum'] ->
Quantum_config<||> ->
Quantum_api_config<||> ->

View File

@ -3,26 +3,23 @@
keys = root, l3agent, ovsagent, dhcpagent, metadata
[handlers]
keys = production,devel, l3agent, ovsagent, dhcpagent, metadata
keys = production,devel,stderr, l3agent, ovsagent, dhcpagent, metadata
<% else -%>
[loggers]
keys = root
# devel is reserved for future usage
[handlers]
keys = production,devel
keys = production,devel,stderr
<% end -%>
[formatters]
keys = normal,debug,default
[logger_root]
level = NOTSET
handlers = production
handlers = production,devel,stderr
propagate = 1
#qualname = quantum
[formatters]
keys = normal,debug,default
[formatter_debug]
format = quantum-%(name)s %(levelname)s: %(module)s %(funcName)s %(message)s
@ -33,24 +30,48 @@ format = quantum-%(name)s %(levelname)s: %(message)s
[formatter_default]
format=%(asctime)s %(levelname)s: %(module)s %(name)s:%(lineno)d %(funcName)s %(message)s
# Extended logging info to LOG_<%= @syslog_log_facility %> with debug:<%= @debug %> and verbose:<%= @verbose %>
# Note: local copy goes to /var/log/quantum-all.log
# logging info to LOG_<%= @syslog_log_facility %> with debug:<%= @debug %> and verbose:<%= @verbose %>
[handler_production]
class = handlers.SysLogHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = ('/dev/log', handlers.SysLogHandler.LOG_<%= @syslog_log_facility %>)
formatter = normal
# TODO find out how it could be usefull and how it should be used
[handler_stderr]
class = StreamHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = (sys.stderr,)
[handler_devel]
class = StreamHandler
<% if @debug then -%>
level = DEBUG
formatter = debug
<% elsif @verbose then -%>
level = INFO
formatter = normal
<% else -%>
level = <%= @syslog_log_level %>
formatter = normal
<% end -%>
args = (sys.stdout,)
<% if @debug then -%>

View File

@ -20,6 +20,7 @@ class rsyslog::client (
$syslog_log_facility_nova = 'LOCAL6',
$syslog_log_facility_keystone = 'LOCAL7',
$log_level = 'NOTICE',
$debug = false,
) inherits rsyslog {
# Fix for udp checksums should be applied if running on virtual node
@ -79,16 +80,189 @@ if $virtual { include rsyslog::checksum_udp514 }
notify => Class["rsyslog::service"],
}
file { "${rsyslog::params::rsyslog_d}02-ha.conf":
ensure => present,
content => template("${module_name}/02-ha.conf.erb"),
}
file { "${rsyslog::params::rsyslog_d}03-dashboard.conf":
ensure => present,
content => template("${module_name}/03-dashboard.conf.erb"),
}
# openstack syslog compatible mode, would work only for debug case.
# because of its poor syslog debug messages quality, use local logs convertion
if $debug =~ /(?i)(true|yes)/ {
::rsyslog::imfile { "10-nova-api_debug" :
file_name => "/var/log/nova/api.log",
file_tag => "nova-api",
file_facility => $syslog_log_facility_nova,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "10-nova-cert_debug" :
file_name => "/var/log/nova/cert.log",
file_tag => "nova-cert",
file_facility => $syslog_log_facility_nova,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "10-nova-consoleauth_debug" :
file_name => "/var/log/nova/consoleauth.log",
file_tag => "nova-consoleauth",
file_facility => $syslog_log_facility_nova,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "10-nova-scheduler_debug" :
file_name => "/var/log/nova/scheduler.log",
file_tag => "nova-scheduler",
file_facility => $syslog_log_facility_nova,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "10-nova-network_debug" :
file_name => "/var/log/nova/network.log",
file_tag => "nova-network",
file_facility => $syslog_log_facility_nova,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "10-nova-compute_debug" :
file_name => "/var/log/nova/compute.log",
file_tag => "nova-compute",
file_facility => $syslog_log_facility_nova,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "10-nova-conductor_debug" :
file_name => "/var/log/nova/conductor.log",
file_tag => "nova-conductor",
file_facility => $syslog_log_facility_nova,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "10-nova-objectstore_debug" :
file_name => "/var/log/nova/objectstore.log",
file_tag => "nova-objectstore",
file_facility => $syslog_log_facility_nova,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "20-keystone_debug" :
file_name => "/var/log/keystone/keystone.log",
file_tag => "keystone",
file_facility => $syslog_log_facility_keystone,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "30-cinder-api_debug" :
file_name => "/var/log/cinder/api.log",
file_tag => "cinder-api",
file_facility => $syslog_log_facility_cinder,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "30-cinder-volume_debug" :
file_name => "/var/log/cinder/volume.log",
file_tag => "cinder-volume",
file_facility => $syslog_log_facility_cinder,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "30-cinder-scheduler_debug" :
file_name => "/var/log/cinder/scheduler.log",
file_tag => "cinder-scheduler",
file_facility => $syslog_log_facility_cinder,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "40-glance-api_debug" :
file_name => "/var/log/glance/api.log",
file_tag => "glance-api",
file_facility => $syslog_log_facility_glance,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "40-glance-registry_debug" :
file_name => "/var/log/glance/registry.log",
file_tag => "glance-registry",
file_facility => $syslog_log_facility_glance,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "50-quantum-server_debug" :
file_name => "/var/log/quantum/server.log",
file_tag => "quantum-server",
file_facility => $syslog_log_facility_quantum,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "50-quantum-ovs-cleanup_debug" :
file_name => "/var/log/quantum/ovs-cleanup.log",
file_tag => "quantum-ovs-cleanup",
file_facility => $syslog_log_facility_quantum,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "50-quantum-rescheduling_debug" :
file_name => "/var/log/quantum/rescheduling.log",
file_tag => "quantum-rescheduling",
file_facility => $syslog_log_facility_quantum,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "50-quantum-ovs-agent_debug" :
file_name => "/var/log/quantum/openvswitch-agent.log",
file_tag => "quantum-agent-ovs",
file_facility => $syslog_log_facility_quantum,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "50-quantum-l3-agent_debug" :
file_name => "/var/log/quantum/l3-agent.log",
file_tag => "quantum-agent-l3",
file_facility => $syslog_log_facility_quantum,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "50-quantum-dhcp-agent_debug" :
file_name => "/var/log/quantum/dhcp-agent.log",
file_tag => "quantum-agent-dhcp",
file_facility => $syslog_log_facility_quantum,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "50-quantum-metadata-agent_debug" :
file_name => "/var/log/quantum/metadata-agent.log",
file_tag => "quantum-agent-metadata",
file_facility => $syslog_log_facility_quantum,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
# FIXME Workaround for FUEL-843 (HA any)
# FIXME remove after FUEL-843 have reolved
::rsyslog::imfile { "50-ha-quantum-ovs-agent_debug" :
file_name => "/var/log/quantum/quantum-openvswitch-agent.log",
file_tag => "quantum-agent-ovs",
file_facility => $syslog_log_facility_quantum,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "50-ha-quantum-l3-agent_debug" :
file_name => "/var/log/quantum/quantum-l3-agent.log",
file_tag => "quantum-agent-l3",
file_facility => $syslog_log_facility_quantum,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "50-ha-quantum-dhcp-agent_debug" :
file_name => "/var/log/quantum/quantum-dhcp-agent.log",
file_tag => "quantum-agent-dhcp",
file_facility => $syslog_log_facility_quantum,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
::rsyslog::imfile { "50-ha-quantum-metadata-agent_debug" :
file_name => "/var/log/quantum/quantum-metadata-agent.log",
file_tag => "quantum-agent-metadata",
file_facility => $syslog_log_facility_quantum,
file_severity => "DEBUG",
notify => Class["rsyslog::service"],
}
# END fixme
} else { #non debug case
# standard logging configs for syslog client
file { "${rsyslog::params::rsyslog_d}10-nova.conf":
ensure => present,
content => template("${module_name}/10-nova.conf.erb"),
@ -113,6 +287,18 @@ if $virtual { include rsyslog::checksum_udp514 }
ensure => present,
content => template("${module_name}/50-quantum.conf.erb"),
}
} #end if
file { "${rsyslog::params::rsyslog_d}02-ha.conf":
ensure => present,
content => template("${module_name}/02-ha.conf.erb"),
}
file { "${rsyslog::params::rsyslog_d}03-dashboard.conf":
ensure => present,
content => template("${module_name}/03-dashboard.conf.erb"),
}
file { "${rsyslog::params::rsyslog_d}60-puppet-agent.conf":
content => template("${module_name}/60-puppet-agent.conf.erb"),

View File

@ -3,13 +3,10 @@
<% if scope.lookupvar('rsyslog::client::log_remote') -%>
# Log to remote syslog server using <%= scope.lookupvar('rsyslog::client::remote_type') %>
# Templates
<% if scope.lookupvar('rsyslog::client::high_precision_timestamps') -%>
# Use high precision timestamps (date-rfc3339, 2010-12-05T02:21:41.889482+01:00)
$Template RemoteLog, "<%%PRI%>%TIMEGENERATED:1:32:date-rfc3339% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%\n"
<% else -%>
# Use traditional timestamps (date-rfc3164, Dec 5 02:21:13)
$Template RemoteLog, "<%%PRI%>%TIMEGENERATED:1:15:date-rfc3164% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%\n"
<% end -%>
# RFC3164 emulation with long tags (32+)
$Template RemoteLog, "<%%pri%>%timestamp% %hostname% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%\n"
# RFC5424 emulation would be: "<%%pri%>1 %timestamp:::date-rfc3339% %hostname% %syslogtag% %procid% %msgid% %structured-data% %msg%\n"
# Note: don't use %app-name% cuz it would be empty for some cases
$ActionFileDefaultTemplate RemoteLog
<% scope.lookupvar('rsyslog::client::rservers_real').each do |rserver| -%>

View File

@ -20,7 +20,6 @@ $EscapeControlCharactersOnReceive off
# Disk-Assisted Memory Queues, async writes, no escape chars
#
$OMFileASyncWriting on
$SystemLogRateLimitInterval 0 # disable rate limits for rsyslog
$MainMsgQueueType LinkedList
$WorkDirectory <%= scope.lookupvar('rsyslog::params::spool_dir') %>
$MainMsgQueueFileName mainmsgqueue

View File

@ -8,7 +8,6 @@ $EscapeControlCharactersOnReceive off
# Disk-Assisted Memory Queues, async writes, no escape chars
#
$OMFileASyncWriting on
$SystemLogRateLimitInterval 0 # disable rate limits for rsyslog
$MainMsgQueueType LinkedList
$WorkDirectory <%= scope.lookupvar('rsyslog::params::spool_dir') %>
$MainMsgQueueFileName mainmsgqueue

View File

@ -1,11 +1,4 @@
# managed by puppet
<% unless scope.lookupvar('rsyslog::client::high_precision_timestamps') -%>
#
# Use traditional timestamp format date-rfc3164 (Dec 5 02:21:13).
# To enable high precision timestamps date-rfc3339 (2010-12-05T02:21:41.889482+01:00), comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
<% end -%>
LOCAL0.* -/var/log/ha.log
LOCAL0.* ~

View File

@ -1,11 +1,4 @@
# managed by puppet
<% unless scope.lookupvar('rsyslog::client::high_precision_timestamps') -%>
#
# Use traditional timestamp format date-rfc3164 (Dec 5 02:21:13).
# To enable high precision timestamps date-rfc3339 (2010-12-05T02:21:41.889482+01:00), comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
<% end -%>
LOCAL1.* -/var/log/dashboard.log
LOCAL1.* ~

View File

@ -1,11 +1,4 @@
# managed by puppet
<% unless scope.lookupvar('rsyslog::client::high_precision_timestamps') -%>
#
# Use traditional timestamp format date-rfc3164 (Dec 5 02:21:13).
# To enable high precision timestamps date-rfc3339 (2010-12-05T02:21:41.889482+01:00), comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
<% end -%>
<%= @syslog_log_facility_nova %>.* -/var/log/nova-all.log
<%= @syslog_log_facility_nova %>.* ~

View File

@ -1,11 +1,4 @@
# managed by puppet
<% unless scope.lookupvar('rsyslog::client::high_precision_timestamps') -%>
#
# Use traditional timestamp format date-rfc3164 (Dec 5 02:21:13).
# To enable high precision timestamps date-rfc3339 (2010-12-05T02:21:41.889482+01:00), comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
<% end -%>
<%= @syslog_log_facility_keystone %>.* -/var/log/keystone-all.log
<%= @syslog_log_facility_keystone %>.* ~

View File

@ -1,11 +1,4 @@
# managed by puppet
<% unless scope.lookupvar('rsyslog::client::high_precision_timestamps') -%>
#
# Use traditional timestamp format date-rfc3164 (Dec 5 02:21:13).
# To enable high precision timestamps date-rfc3339 (2010-12-05T02:21:41.889482+01:00), comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
<% end -%>
<%= @syslog_log_facility_cinder %>.* -/var/log/cinder-all.log
<%= @syslog_log_facility_cinder %>.* ~

View File

@ -1,11 +1,4 @@
# managed by puppet
<% unless scope.lookupvar('rsyslog::client::high_precision_timestamps') -%>
#
# Use traditional timestamp format date-rfc3164 (Dec 5 02:21:13).
# To enable high precision timestamps date-rfc3339 (2010-12-05T02:21:41.889482+01:00), comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
<% end -%>
<%= @syslog_log_facility_glance %>.* -/var/log/glance-all.log
<%= @syslog_log_facility_glance %>.* ~

View File

@ -1,11 +1,4 @@
# managed by puppet
<% unless scope.lookupvar('rsyslog::client::high_precision_timestamps') -%>
#
# Use traditional timestamp format date-rfc3164 (Dec 5 02:21:13).
# To enable high precision timestamps date-rfc3339 (2010-12-05T02:21:41.889482+01:00), comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
<% end -%>
<%= @syslog_log_facility_quantum %>.* -/var/log/quantum-all.log
<%= @syslog_log_facility_quantum %>.* ~

View File

@ -1,10 +1,3 @@
# file is managed by puppet
<% unless @high_precision_timestamps -%>
#
# Use traditional timestamp format date-rfc3164 (Dec 5 02:21:13).
# To enable high precision timestamps date-rfc3339 (2010-12-05T02:21:41.889482+01:00), comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
<% end -%>
if $programname == 'puppet-agent' then /var/log/puppet/agent.log

View File

@ -1,12 +1,5 @@
# file is managed by puppet
#
<% unless scope.lookupvar('rsyslog::client::high_precision_timestamps') -%>
#
# Use traditional timestamp format date-rfc3164 (Dec 5 02:21:13).
# To enable high precision timestamps date-rfc3339 (2010-12-05T02:21:41.889482+01:00), comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
<% end -%>
<% if scope.lookupvar('rsyslog::client::log_auth_local') or scope.lookupvar('rsyslog::client::log_local') -%>
# Log auth messages locally

View File

@ -45,7 +45,10 @@ class swift::proxy(
$workers = $::processorcount,
$allow_account_management = true,
$account_autocreate = true,
$package_ensure = 'present'
$package_ensure = 'present',
$debug = false,
$verbose = true,
$syslog_log_level = 'WARNING',
) {
include 'swift::params'

View File

@ -27,6 +27,9 @@ class swift::storage::all(
$container_pipeline = undef,
$account_pipeline = undef,
$export_devices = false,
$debug = false,
$verbose = true,
$syslog_log_level = 'WARNING',
) {
class { 'swift::storage':
@ -69,6 +72,9 @@ class swift::storage::all(
swift_zone => $swift_zone,
devices => $devices,
storage_local_net_ip => $storage_local_net_ip,
debug => $debug,
verbose => $verbose,
syslog_log_level => $syslog_log_level,
}
swift::storage::server { $account_port:

View File

@ -20,7 +20,10 @@ define swift::storage::server(
$updater_concurrency = $::processorcount,
$reaper_concurrency = $::processorcount,
# this parameters needs to be specified after type and name
$config_file_path = "${type}-server/${name}.conf"
$config_file_path = "${type}-server/${name}.conf",
$debug = false,
$verbose = true,
$syslog_log_level = 'WARNING',
) {
if (is_array($pipeline)) {
$pipeline_real = $pipeline

View File

@ -5,12 +5,12 @@ bind_port = <%= bind_port %>
mount_check = <%= mount_check %>
user = <%= user %>
log_facility = LOG_SYSLOG
<% if scope.lookupvar('::debug') then -%>
<% if @debug then -%>
log_level = DEBUG
<% elsif scope.lookupvar('::verbose') then -%>
<% elsif @verbose then -%>
log_level = INFO
<% else -%>
log_level = <%= scope.lookupvar('::syslog_log_level') %>
log_level = <%= @syslog_log_level %>
<% end -%>
log_name = swift-account-server
workers = <%= workers %>

View File

@ -5,12 +5,12 @@ bind_port = <%= bind_port %>
mount_check = <%= mount_check %>
user = <%= user %>
log_facility = LOG_SYSLOG
<% if scope.lookupvar('::debug') then -%>
<% if @debug then -%>
log_level = DEBUG
<% elsif scope.lookupvar('::verbose') then -%>
<% elsif @verbose then -%>
log_level = INFO
<% else -%>
log_level = <%= scope.lookupvar('::syslog_log_level') %>
log_level = <%= @syslog_log_level %>
<% end -%>
log_name = swift-container-server
workers = <%= workers %>

View File

@ -5,12 +5,12 @@ bind_port = <%= bind_port %>
mount_check = <%= mount_check %>
user = <%= user %>
log_facility = LOG_SYSLOG
<% if scope.lookupvar('::debug') then -%>
<% if @debug then -%>
log_level = DEBUG
<% elsif scope.lookupvar('::verbose') then -%>
<% elsif @verbose then -%>
log_level = INFO
<% else -%>
log_level = <%= scope.lookupvar('::syslog_log_level') %>
log_level = <%= @syslog_log_level %>
<% end -%>
log_name = swift-object-server
workers = <%= workers %>

View File

@ -5,12 +5,12 @@ bind_ip = <%= proxy_local_net_ip %>
bind_port = <%= port %>
workers = <%= workers %>
log_facility = LOG_SYSLOG
<% if scope.lookupvar('::debug') then -%>
<% if @debug then -%>
log_level = DEBUG
<% elsif scope.lookupvar('::verbose') then -%>
<% elsif @verbose then -%>
log_level = INFO
<% else -%>
log_level = <%= scope.lookupvar('::syslog_log_level') %>
log_level = <%= @syslog_log_level %>
<% end -%>
log_name = swift-proxy-server
user = swift

View File

@ -32,8 +32,8 @@ puppet apply -e "
log_remote => false,
log_local => true,
log_auth_local => true,
rotation => 'daily',
keep => '7',
rotation => 'weekly',
keep => '4',
# should be > 30M
limitsize => '100M',
port => '514',