removes deprecated rsyslogd -c option on newer packages.
-c options will be deprecated after 5.8.6-1ubuntu8.9, using it will cause rsyslogd to not start. Change-Id: I05c8565ebafae8df9ba7b54b9cfe6af3c4379620 Closes-Bug: #1488237 Co-Authored-By:Bartłomiej Piotrowski <bpiotrowski@mirantis.com>
This commit is contained in:
parent
befd1a4ef3
commit
122e8445be
@ -1,8 +0,0 @@
|
||||
# File is managed by puppet
|
||||
|
||||
# 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
|
||||
# RSYSLOGD_OPTIONS="-c4"
|
||||
RSYSLOGD_OPTIONS="-c 5 -x"
|
38
deployment/puppet/rsyslog/lib/facter/rsyslog_version.rb
Normal file
38
deployment/puppet/rsyslog/lib/facter/rsyslog_version.rb
Normal file
@ -0,0 +1,38 @@
|
||||
# Fact: :syslog_package
|
||||
#
|
||||
# Purpose: retrieve installed rsyslog version
|
||||
#
|
||||
|
||||
Facter.add(:rsyslog_version) do
|
||||
setcode do
|
||||
osfamily = Facter.value('osfamily')
|
||||
case osfamily
|
||||
when "Debian"
|
||||
command='/usr/bin/dpkg-query -f \'${Status};${Version};\' -W rsyslog 2>/dev/null'
|
||||
version = Facter::Util::Resolution.exec(command)
|
||||
if version =~ /.*install ok installed;([^;]+);.*/
|
||||
$1
|
||||
else
|
||||
nil
|
||||
end
|
||||
when "RedHat", "Suse"
|
||||
command='rpm -qa --qf "%{VERSION}" "rsyslog"'
|
||||
version = Facter::Util::Resolution.exec(command)
|
||||
if version =~ /^(.+)$/
|
||||
$1
|
||||
else
|
||||
nil
|
||||
end
|
||||
when "FreeBSD"
|
||||
command='pkg query %v rsyslog'
|
||||
version = Facter::Util::Resolution.exec(command)
|
||||
if version =~ /^(.+)$/
|
||||
$1
|
||||
else
|
||||
nil
|
||||
end
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
@ -19,22 +19,11 @@ class rsyslog::config {
|
||||
path => $::rsyslog::params::rsyslog_queues_dir,
|
||||
}
|
||||
|
||||
case $osfamily {
|
||||
'Debian': {
|
||||
file { $rsyslog::params::rsyslog_default:
|
||||
ensure => file,
|
||||
source => "puppet:///modules/rsyslog/rsyslog_default",
|
||||
}
|
||||
file { $rsyslog::params::rsyslog_default:
|
||||
ensure => file,
|
||||
content => template("${module_name}/rsyslog_default.erb"),
|
||||
}
|
||||
'RedHat': {
|
||||
file { "/etc/sysconfig/rsyslog":
|
||||
content => template("rsyslog/rsyslog.erb"),
|
||||
}
|
||||
}
|
||||
default: {
|
||||
fail("Unsupported osfamily: ${osfamily} for os ${operatingsystem}")
|
||||
}
|
||||
}
|
||||
|
||||
file { $rsyslog::params::spool_dir:
|
||||
ensure => directory,
|
||||
}
|
||||
|
12
deployment/puppet/rsyslog/templates/rsyslog_default.erb
Normal file
12
deployment/puppet/rsyslog/templates/rsyslog_default.erb
Normal file
@ -0,0 +1,12 @@
|
||||
# File is managed by puppet
|
||||
|
||||
<% if @rsyslog_version and @rsyslog_version.split('.')[0].to_i < 7 -%>
|
||||
# Debian, Ubuntu
|
||||
RSYSLOGD_OPTIONS="-c4"
|
||||
<% else -%>
|
||||
RSYSLOGD_OPTIONS=""
|
||||
<% end -%>
|
||||
<% if @osfamily.casecmp('redhat') -%>
|
||||
# CentOS, RedHat, Fedora
|
||||
SYSLOGD_OPTIONS="${RSYSLOGD_OPTIONS}"
|
||||
<% end -%>
|
Loading…
Reference in New Issue
Block a user