Fix proto & port options for logging, add virtual & show_timezones
Signed-off-by: Bogdan Dobrelya <bogdando@mail.ru>
This commit is contained in:
@@ -407,15 +407,20 @@ $syslog_log_facility_keystone = 'LOCAL7'
|
||||
|
||||
if $use_syslog {
|
||||
class { "::openstack::logging":
|
||||
stage => 'first',
|
||||
role => 'client',
|
||||
# log both locally include auth, and remote
|
||||
log_remote => true,
|
||||
log_local => true,
|
||||
log_auth_local => true,
|
||||
# keep four weekly log rotations, force rotate if 300M size have exceeded
|
||||
rotation => 'weekly',
|
||||
keep => '4',
|
||||
limitsize => '300M',
|
||||
stage => 'first',
|
||||
# remote servers to send logs to
|
||||
rservers => [{'remote_type'=>'udp', 'server'=>'master', 'port'=>'514'},],
|
||||
# should be true, if client is running at virtual node
|
||||
virtual => true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -425,13 +430,16 @@ if $use_syslog {
|
||||
# log_remote => false,
|
||||
# log_local => true,
|
||||
# log_auth_local => true,
|
||||
# rotation => 'daily',
|
||||
# rotation => 'daily',
|
||||
# keep => '7',
|
||||
# limitsize => '100M',
|
||||
# port => '514',
|
||||
# port => '514',
|
||||
# proto => 'udp',
|
||||
# #high precision timespamps
|
||||
# show_timezone => true,
|
||||
# #should be true, if server is running at virtual node
|
||||
# #virtual => false,
|
||||
# }
|
||||
|
||||
### Syslog END ###
|
||||
case $::osfamily {
|
||||
"Debian": {
|
||||
|
||||
@@ -376,15 +376,20 @@ $syslog_log_facility_keystone = 'LOCAL7'
|
||||
|
||||
if $use_syslog {
|
||||
class { "::openstack::logging":
|
||||
stage => 'first',
|
||||
role => 'client',
|
||||
# log both locally include auth, and remote
|
||||
log_remote => true,
|
||||
log_local => true,
|
||||
log_auth_local => true,
|
||||
# keep four weekly log rotations, force rotate if 300M size have exceeded
|
||||
rotation => 'weekly',
|
||||
keep => '4',
|
||||
limitsize => '300M',
|
||||
stage => 'first',
|
||||
# remote servers to send logs to
|
||||
rservers => [{'remote_type'=>'udp', 'server'=>'master', 'port'=>'514'},],
|
||||
# should be true, if client is running at virtual node
|
||||
virtual => true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,13 +399,16 @@ if $use_syslog {
|
||||
# log_remote => false,
|
||||
# log_local => true,
|
||||
# log_auth_local => true,
|
||||
# rotation => 'daily',
|
||||
# rotation => 'daily',
|
||||
# keep => '7',
|
||||
# limitsize => '100M',
|
||||
# port => '514',
|
||||
# port => '514',
|
||||
# proto => 'udp',
|
||||
# #high precision timespamps
|
||||
# show_timezone => true,
|
||||
# #should be true, if server is running at virtual node
|
||||
# #virtual => false,
|
||||
# }
|
||||
|
||||
### Syslog END ###
|
||||
case $::osfamily {
|
||||
"Debian": {
|
||||
|
||||
@@ -318,34 +318,40 @@ $syslog_log_facility_keystone = 'LOCAL7'
|
||||
|
||||
if $use_syslog {
|
||||
class { "::openstack::logging":
|
||||
stage => 'first',
|
||||
role => 'client',
|
||||
# log both locally include auth, and remote
|
||||
log_remote => true,
|
||||
log_local => true,
|
||||
log_auth_local => true,
|
||||
# keep four weekly log rotations, force rotate if 300M size have exceeded
|
||||
rotation => 'weekly',
|
||||
keep => '4',
|
||||
limitsize => '300M',
|
||||
stage => 'first',
|
||||
# remote servers to send logs to
|
||||
rservers => [{'remote_type'=>'udp', 'server'=>'master', 'port'=>'514'},],
|
||||
# should be true, if client is running at virtual node
|
||||
virtual => true,
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# Example for server role class definition for remote logging node:
|
||||
# class {::openstack::logging:
|
||||
# role => 'server',
|
||||
# log_remote => false,
|
||||
# log_local => true,
|
||||
# log_auth_local => true,
|
||||
# rotation => 'daily',
|
||||
# rotation => 'daily',
|
||||
# keep => '7',
|
||||
# limitsize => '100M',
|
||||
# port => '514',
|
||||
# port => '514',
|
||||
# proto => 'udp',
|
||||
# #high precision timespamps
|
||||
# show_timezone => true,
|
||||
# #should be true, if server is running at virtual node
|
||||
# #virtual => false,
|
||||
# }
|
||||
|
||||
### Syslog END ###
|
||||
|
||||
|
||||
case $::osfamily {
|
||||
"Debian": {
|
||||
$rabbitmq_version_string = '2.8.7-1'
|
||||
|
||||
@@ -292,15 +292,20 @@ $syslog_log_facility_keystone = 'LOCAL7'
|
||||
|
||||
if $use_syslog {
|
||||
class { "::openstack::logging":
|
||||
stage => 'first',
|
||||
role => 'client',
|
||||
# log both locally include auth, and remote
|
||||
log_remote => true,
|
||||
log_local => true,
|
||||
log_auth_local => true,
|
||||
# keep four weekly log rotations, force rotate if 300M size have exceeded
|
||||
rotation => 'weekly',
|
||||
keep => '4',
|
||||
limitsize => '300M',
|
||||
stage => 'first',
|
||||
# remote servers to send logs to
|
||||
rservers => [{'remote_type'=>'udp', 'server'=>'master', 'port'=>'514'},],
|
||||
# should be true, if client is running at virtual node
|
||||
virtual => true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,11 +320,12 @@ if $use_syslog {
|
||||
# limitsize => '100M',
|
||||
# port => '514',
|
||||
# proto => 'udp',
|
||||
# #high precision timespamps
|
||||
# show_timezone => true,
|
||||
# #should be true, if server is running at virtual node
|
||||
# #virtual => false,
|
||||
# }
|
||||
|
||||
### Syslog END ###
|
||||
|
||||
|
||||
case $::osfamily {
|
||||
"Debian": {
|
||||
$rabbitmq_version_string = '2.8.7-1'
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
# [rservers] array of hashes which represents remote logging servers for client role.
|
||||
# [port] port to use by server role for remote logging.
|
||||
# [proto] tcp/udp proto for remote log server role.
|
||||
# [show_timezone] if enabled, high_precision_timestamps with GMT would be used for server role.
|
||||
# [virtual] if node is virtual, fix for udp checksums should be applied
|
||||
|
||||
class openstack::logging (
|
||||
$role = 'client',
|
||||
@@ -21,6 +23,8 @@ class openstack::logging (
|
||||
$rservers = [{'remote_type'=>'udp', 'server'=>'master', 'port'=>'514'},],
|
||||
$port = '514',
|
||||
$proto = 'udp',
|
||||
$show_timezone = false,
|
||||
$virtual = false,
|
||||
) {
|
||||
|
||||
validate_re($proto, 'tcp|udp')
|
||||
@@ -33,6 +37,7 @@ if $role == 'client' {
|
||||
log_local => $log_local,
|
||||
log_auth_local => $log_auth_local,
|
||||
rservers => $rservers,
|
||||
virtual => $virtual,
|
||||
} ->
|
||||
# FIXME Find more appropriate way to ensure rsyslog service would be restarted
|
||||
# while custom runstage openstack::logging class has been called within
|
||||
@@ -49,8 +54,11 @@ if $role == 'client' {
|
||||
action => 'accept',
|
||||
} ->
|
||||
class {"::rsyslog::server":
|
||||
enable_tcp => false,
|
||||
server_dir => '/var/log/'
|
||||
enable_tcp => $proto == 'tcp' ? { true => 'true', default =>'false' },
|
||||
enable_udp => $proto == 'udp' ? { true => 'true', default =>'true' },
|
||||
server_dir => '/var/log/',
|
||||
high_precision_timestamps => $show_timezone,
|
||||
virtual => $virtual,
|
||||
} ->
|
||||
# FIXME Find more appropriate way to ensure rsyslog service would be restarted
|
||||
# while custom runstage openstack::logging class has been called within
|
||||
|
||||
@@ -11,10 +11,12 @@ class rsyslog::client (
|
||||
$server = 'master',
|
||||
$port = '514',
|
||||
$escapenewline = false,
|
||||
$rservers = undef
|
||||
$rservers = undef,
|
||||
$virtual = false,
|
||||
) inherits rsyslog {
|
||||
|
||||
include rsyslog::checksum_udp514
|
||||
# Fix for udp checksums should be applied if running on virtual node
|
||||
if $virtual { include rsyslog::checksum_udp514 }
|
||||
|
||||
if $rservers == undef {
|
||||
$rservers_real = [{'remote_type'=>$remote_type, 'server'=>$server, 'port'=>$port}]
|
||||
|
||||
@@ -8,10 +8,12 @@ class rsyslog::server (
|
||||
$server_dir = '/srv/log/',
|
||||
$custom_config = undef,
|
||||
$high_precision_timestamps = false,
|
||||
$escapenewline = false
|
||||
$escapenewline = false,
|
||||
$virtual = true,
|
||||
) inherits rsyslog {
|
||||
|
||||
include rsyslog::checksum_udp514
|
||||
# Fix for udp checksums should be applied if running on virtual node
|
||||
if $virtual { include rsyslog::checksum_udp514 }
|
||||
|
||||
File {
|
||||
owner => root,
|
||||
|
||||
@@ -11,11 +11,11 @@ $ModLoad imtcp
|
||||
<% end -%>
|
||||
|
||||
<% if scope.lookupvar('rsyslog::server::enable_udp') -%>
|
||||
$UDPServerRun 514
|
||||
$UDPServerRun <%= scope.lookupvar('rsyslog::server::port') %>
|
||||
<% end -%>
|
||||
|
||||
<% if scope.lookupvar('rsyslog::server::enable_tcp') -%>
|
||||
$InputTCPServerRun 514
|
||||
$InputTCPServerRun <%= scope.lookupvar('rsyslog::server::port') %>
|
||||
<% end -%>
|
||||
|
||||
<% unless scope.lookupvar('rsyslog::server::escapenewline') -%>
|
||||
@@ -49,7 +49,9 @@ $SystemLogRateLimitInterval 0 # disable rate limits for rsyslog
|
||||
# Use traditional timestamp format.
|
||||
# To enable high precision timestamps, comment out the following line.
|
||||
#
|
||||
<% unless scope.lookupvar('rsyslog::server::high_precision_timestamps') -%>
|
||||
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
|
||||
<% end -%>
|
||||
|
||||
# Templates
|
||||
#$Template dynAuthLog,"<%= scope.lookupvar('rsyslog::server::server_dir') -%>%source:R,ERE,1,DFLT:([A-Za-z-]*)--end%/auth.log"
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<% if scope.lookupvar('rsyslog::client::log_remote') -%>
|
||||
# Log to remote syslog server using <%= scope.lookupvar('rsyslog::client::remote_type') %>
|
||||
# Templates
|
||||
# Would match 'kernel:' -> 'kernel' ; 'rsyslog[12345]:' -> 'rsyslog' ; '<180>(nova.api.wsgi):' -> 'nova.api.wsgi'
|
||||
$Template CustomLog, "%$NOW%T%TIMESTAMP:8:$%Z %syslogseverity-text% %syslogtag% %msg:drop-last-lf%\n"
|
||||
|
||||
<% scope.lookupvar('rsyslog::client::rservers_real').each do |rserver| -%>
|
||||
|
||||
@@ -37,6 +37,8 @@ puppet apply -e "
|
||||
limitsize => '100M',
|
||||
port => '514',
|
||||
proto => 'udp',
|
||||
show_timezone => true,
|
||||
#virtual => false,
|
||||
}"
|
||||
puppet apply -e "
|
||||
class {openstack::mirantis_repos: enable_epel => false } ->
|
||||
|
||||
Reference in New Issue
Block a user