From 46c06ec3bd8350e67cbbbc8dea9d2aee7d74a75a Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 16 Jun 2014 18:02:06 +0300 Subject: [PATCH] Add missed 30-remote-log.conf for docker container Add missed 30-remote.conf template for rsyslog docker container Fix existing dependency issue (rsyslog::server wipes templates dir) Fix default access and notification for rsyslog.d file resources Purge confusing nailgun templates for syslog (not used anymore) Closes-bug: #1328877 Change-Id: If6f256cfeeba5bee486dd45c34cbc56c9e721730 Signed-off-by: Bogdan Dobrelya --- .../puppet/nailgun/examples/rsyslog-only.pp | 11 ++++++ .../puppet/nailgun/manifests/rsyslog.pp | 34 ------------------- .../templates/rsyslog/30-remote-log.conf.erb | 10 ------ .../templates/rsyslog/50-puppet-log.conf.erb | 4 --- .../nailgun/templates/rsyslog/rsyslog.erb | 5 --- .../puppet/openstack/manifests/logging.pp | 30 ++++++++-------- 6 files changed, 27 insertions(+), 67 deletions(-) delete mode 100644 deployment/puppet/nailgun/manifests/rsyslog.pp delete mode 100644 deployment/puppet/nailgun/templates/rsyslog/30-remote-log.conf.erb delete mode 100644 deployment/puppet/nailgun/templates/rsyslog/50-puppet-log.conf.erb delete mode 100644 deployment/puppet/nailgun/templates/rsyslog/rsyslog.erb diff --git a/deployment/puppet/nailgun/examples/rsyslog-only.pp b/deployment/puppet/nailgun/examples/rsyslog-only.pp index c3e145494b..a11546ee33 100644 --- a/deployment/puppet/nailgun/examples/rsyslog-only.pp +++ b/deployment/puppet/nailgun/examples/rsyslog-only.pp @@ -9,6 +9,17 @@ class {"::rsyslog::server": high_precision_timestamps => true, } +# Fuel specific config for logging parse formats used for /var/log/remote +$logconf = "${::rsyslog::params::rsyslog_d}30-remote-log.conf" +file { $logconf : + content => template('openstack/30-server-remote-log.conf.erb'), + require => Class['::rsyslog::server'], + owner => root, + group => $::rsyslog::params::run_group, + mode => 0640, + notify => Class["::rsyslog::service"], +} + class {"::openstack::logrotate": role => 'server', rotation => 'weekly', diff --git a/deployment/puppet/nailgun/manifests/rsyslog.pp b/deployment/puppet/nailgun/manifests/rsyslog.pp deleted file mode 100644 index f69d95f1f5..0000000000 --- a/deployment/puppet/nailgun/manifests/rsyslog.pp +++ /dev/null @@ -1,34 +0,0 @@ -class nailgun::rsyslog { - - file { "/etc/rsyslog.d/30-remote-log.conf": - content => template("nailgun/rsyslog/30-remote-log.conf.erb"), - owner => "root", - group => "root", - mode => 0644, - notify => Service["rsyslog"], - } - - file { "/etc/sysconfig/rsyslog": - content => template("nailgun/rsyslog/rsyslog.erb"), - owner => "root", - group => "root", - mode => 0644, - notify => Service["rsyslog"], - } - file { "/etc/rsyslog.d/50-puppet-log.conf": - content => template("nailgun/rsyslog/50-puppet-log.conf.erb"), - owner => "root", - group => "root", - mode => 0644, - notify => Service["rsyslog"], - } - - - service { "rsyslog": - enable => true, - ensure => "running", - require => Package["rsyslog"], - } - -} - diff --git a/deployment/puppet/nailgun/templates/rsyslog/30-remote-log.conf.erb b/deployment/puppet/nailgun/templates/rsyslog/30-remote-log.conf.erb deleted file mode 100644 index fd195b0cdb..0000000000 --- a/deployment/puppet/nailgun/templates/rsyslog/30-remote-log.conf.erb +++ /dev/null @@ -1,10 +0,0 @@ -# provides UDP syslog reception -$ModLoad imudp -$UDPServerRun 514 -$EscapeControlCharactersOnReceive off - -# remote anaconda logs -$template RemoteLog, "%$NOW%T%TIMESTAMP:8:$% %syslogseverity-text%: %msg%\n" -$template RemoteLogFile, "/var/log/remote/%FROMHOST%/%APP-NAME%.log" -:FROMHOST, regex, "^[1-9]" ?RemoteLogFile;RemoteLog -:FROMHOST, regex, "^[1-9]" ~ diff --git a/deployment/puppet/nailgun/templates/rsyslog/50-puppet-log.conf.erb b/deployment/puppet/nailgun/templates/rsyslog/50-puppet-log.conf.erb deleted file mode 100644 index e07689fc7d..0000000000 --- a/deployment/puppet/nailgun/templates/rsyslog/50-puppet-log.conf.erb +++ /dev/null @@ -1,4 +0,0 @@ -# Collect Puppet logs -$template PuppetLog, "%$NOW%T%TIMESTAMP:8:$% %syslogseverity-text%: %msg%\n" -$template PuppetLogFile, "/var/log/puppet/%APP-NAME%.log" -:APP-NAME, regex, "puppet" ?PuppetLogFile;PuppetLog diff --git a/deployment/puppet/nailgun/templates/rsyslog/rsyslog.erb b/deployment/puppet/nailgun/templates/rsyslog/rsyslog.erb deleted file mode 100644 index 455fa2a309..0000000000 --- a/deployment/puppet/nailgun/templates/rsyslog/rsyslog.erb +++ /dev/null @@ -1,5 +0,0 @@ -# Options for rsyslogd -# Syslogd options are deprecated since rsyslog v3. -# If you want to use them, switch to compatibility mode 2 by "-c 2" -# See rsyslogd(8) for more details -SYSLOGD_OPTIONS="-c 5 -x" diff --git a/deployment/puppet/openstack/manifests/logging.pp b/deployment/puppet/openstack/manifests/logging.pp index 6adc0c74b1..31116ad9e7 100644 --- a/deployment/puppet/openstack/manifests/logging.pp +++ b/deployment/puppet/openstack/manifests/logging.pp @@ -46,6 +46,14 @@ class openstack::logging ( include ::rsyslog::params + # Set access and notifications for rsyslog client + File { + owner => root, + group => $::rsyslog::params::run_group, + mode => 0640, + notify => Class["::rsyslog::service"], + } + # Configure syslog roles if $role == 'client' { @@ -99,14 +107,6 @@ class openstack::logging ( notify => Class["::rsyslog::service"], } - # Set access and notifications for rsyslog client - File { - owner => root, - group => $::rsyslog::params::run_group, - mode => 0640, - notify => Class["::rsyslog::service"], - } - # OS syslog configs for rsyslog client file { "${::rsyslog::params::rsyslog_d}10-nova.conf": ensure => present, @@ -221,12 +221,6 @@ class openstack::logging ( $enable_udp = $proto ? { 'udp' => true, 'both' => true, default => true } } - # Fuel specific config for logging parse formats used for /var/log/remote - $logconf = "${::rsyslog::params::rsyslog_d}30-remote-log.conf" - file { $logconf : - content => template("${module_name}/30-server-remote-log.conf.erb"), - } - class {"::rsyslog::server": enable_tcp => $enable_tcp, enable_udp => $enable_udp, @@ -234,6 +228,14 @@ class openstack::logging ( high_precision_timestamps => $show_timezone, port => $port, } + + # Fuel specific config for logging parse formats used for /var/log/remote + $logconf = "${::rsyslog::params::rsyslog_d}30-remote-log.conf" + file { $logconf : + content => template("${module_name}/30-server-remote-log.conf.erb"), + require => Class['::rsyslog::server'], + } + } # Configure log rotation