From b8ef11c23949d12732ad5cdaebb3023ff39a297a Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 17 Sep 2014 11:11:45 -0400 Subject: Move default file to template to take advantage of rsyslog_version fact and different flags available pre version 7 - Fixes #61 --- files/rsyslog_default | 7 ------- files/rsyslog_default_gentoo | 16 ---------------- files/rsyslog_default_rhel7 | 2 -- manifests/config.pp | 2 +- templates/rsyslog_default.erb | 9 +++++++++ templates/rsyslog_default_gentoo.erb | 16 ++++++++++++++++ templates/rsyslog_default_rhel7.erb | 2 ++ 7 files changed, 28 insertions(+), 26 deletions(-) delete mode 100644 files/rsyslog_default delete mode 100644 files/rsyslog_default_gentoo delete mode 100644 files/rsyslog_default_rhel7 create mode 100644 templates/rsyslog_default.erb create mode 100644 templates/rsyslog_default_gentoo.erb create mode 100644 templates/rsyslog_default_rhel7.erb diff --git a/files/rsyslog_default b/files/rsyslog_default deleted file mode 100644 index 1f11cd3..0000000 --- a/files/rsyslog_default +++ /dev/null @@ -1,7 +0,0 @@ -# File is managed by puppet - -# Debian, Ubuntu -RSYSLOGD_OPTIONS="-c4" - -# CentOS, RedHat, Fedora -SYSLOGD_OPTIONS="${RSYSLOGD_OPTIONS}" diff --git a/files/rsyslog_default_gentoo b/files/rsyslog_default_gentoo deleted file mode 100644 index f5de7b5..0000000 --- a/files/rsyslog_default_gentoo +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/rsyslog/files/7-stable/rsyslog.confd,v 1.1 2012/11/20 13:03:36 ultrabug Exp $ - -# Configuration file -CONFIGFILE="/etc/rsyslog.conf" - -# PID file -PIDFILE="/var/run/rsyslogd.pid" - -# Options to rsyslogd -# See rsyslogd(8) for more details -# Notes: -# * Do not specify another PIDFILE but use the variable above to change the location -# * Do not specify another CONFIGFILE but use the variable above to change the location -RSYSLOG_OPTS="" diff --git a/files/rsyslog_default_rhel7 b/files/rsyslog_default_rhel7 deleted file mode 100644 index c3b95c7..0000000 --- a/files/rsyslog_default_rhel7 +++ /dev/null @@ -1,2 +0,0 @@ -# File is managed by puppet -SYSLOGD_OPTIONS="" diff --git a/manifests/config.pp b/manifests/config.pp index 813e784..1aebe47 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -34,7 +34,7 @@ class rsyslog::config { ensure => file, owner => 'root', group => $rsyslog::run_group, - source => "puppet:///modules/rsyslog/${rsyslog::rsyslog_default_file}", + content => template("${module_name}/${rsyslog::rsyslog_default_file}.erb"), require => Class['rsyslog::install'], notify => Class['rsyslog::service'], } diff --git a/templates/rsyslog_default.erb b/templates/rsyslog_default.erb new file mode 100644 index 0000000..a49eb59 --- /dev/null +++ b/templates/rsyslog_default.erb @@ -0,0 +1,9 @@ +# File is managed by puppet + +<% if @rsyslog_version and @rsyslog_version.split('.')[0].to_i < 7 -%> +# Debian, Ubuntu +RSYSLOGD_OPTIONS="-c4" +<% end -%> + +# CentOS, RedHat, Fedora +SYSLOGD_OPTIONS="${RSYSLOGD_OPTIONS}" diff --git a/templates/rsyslog_default_gentoo.erb b/templates/rsyslog_default_gentoo.erb new file mode 100644 index 0000000..f5de7b5 --- /dev/null +++ b/templates/rsyslog_default_gentoo.erb @@ -0,0 +1,16 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/rsyslog/files/7-stable/rsyslog.confd,v 1.1 2012/11/20 13:03:36 ultrabug Exp $ + +# Configuration file +CONFIGFILE="/etc/rsyslog.conf" + +# PID file +PIDFILE="/var/run/rsyslogd.pid" + +# Options to rsyslogd +# See rsyslogd(8) for more details +# Notes: +# * Do not specify another PIDFILE but use the variable above to change the location +# * Do not specify another CONFIGFILE but use the variable above to change the location +RSYSLOG_OPTS="" diff --git a/templates/rsyslog_default_rhel7.erb b/templates/rsyslog_default_rhel7.erb new file mode 100644 index 0000000..c3b95c7 --- /dev/null +++ b/templates/rsyslog_default_rhel7.erb @@ -0,0 +1,2 @@ +# File is managed by puppet +SYSLOGD_OPTIONS="" -- cgit v1.2.3