Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
# @param rsyslog_default_file
# `rsyslog_d` file template to use
#
# @param rsyslog_default_file_absolute_path
# `rsyslog_d` Use rsyslog_default_file as the absolute template path
#
# @param run_user
# Which user rsyslog should run as
#
Expand Down Expand Up @@ -150,6 +153,7 @@
String[1] $rsyslog_conf_template_file = "${module_name}/rsyslog.conf.erb",
Stdlib::Absolutepath $rsyslog_default = $rsyslog::params::rsyslog_default,
String[1] $rsyslog_default_file = $rsyslog::params::default_config_file,
Boolean $rsyslog_default_file_absolute_path = false,
String[1] $run_user = $rsyslog::params::run_user,
String[1] $run_group = $rsyslog::params::run_group,
String[1] $log_user = $rsyslog::params::log_user,
Expand Down Expand Up @@ -208,13 +212,24 @@
require => File[$rsyslog_d],
}

file { $rsyslog_default:
ensure => file,
owner => 'root',
group => $run_group,
content => template("${module_name}/${rsyslog_default_file}.erb"),
notify => Service[$service_name],
require => File[$rsyslog_conf],
if($rsyslog_default_file_absolute_path == false ) {
file { $rsyslog_default:
ensure => file,
owner => 'root',
group => $run_group,
content => template("${rsyslog_default_file}.erb"),
notify => Service[$service_name],
require => File[$rsyslog_conf],
}
} else {
file { $rsyslog_default:
ensure => file,
owner => 'root',
group => $run_group,
content => template("${module_name}/${rsyslog_default_file}.erb"),
notify => Service[$service_name],
require => File[$rsyslog_conf],
}
}

file { $spool_dir:
Expand Down
2 changes: 1 addition & 1 deletion templates/client/remote.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<% else -%>
<% dropaction = '' -%>
<% end -%>
<%= pattern %> to <%= host %> via <%= server['protocol'].downcase %> on <%= port %> using <%=format_type %> format.
# Sending logs that match <%= pattern %> to <%= host %> via <%= server['protocol'].downcase %> on <%= port %> using <%=format_type %> format.
<%= pattern %> <%= protocol %><%= host %>:<%= port %><%= format %>
<%= dropaction %>
<% end -%>
Expand Down