Skip to content

Add variables for conf_owner_name, conf_group_name and confdir_group_name for OS' that don't use root as group. owner_name for completeness #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
rsyslog::confdir: /etc/rsyslog.d
rsyslog::conf_owner_name: root
rsyslog::conf_group_name: root
rsyslog::confdir_group_name: root
rsyslog::package_name: rsyslog
rsyslog::package_version: installed
rsyslog::manage_package: true
Expand Down
6 changes: 4 additions & 2 deletions manifests/base.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
if $rsyslog::manage_confdir {
file { $rsyslog::confdir:
ensure => directory,
owner => 'root',
group => 'root',
owner => $rsyslog::conf_owner_name,
group => $rsyslog::confdir_group_name,
mode => $rsyslog::confdir_permissions,
purge => $rsyslog::purge_config_files,
recurse => $rsyslog::purge_config_files,
Expand All @@ -60,6 +60,8 @@
ensure => file,
content => "${message}\n\$IncludeConfig ${rsyslog::confdir}/*.conf\n",
mode => $rsyslog::global_conf_perms,
owner => $rsyslog::conf_owner_name,
group => $rsyslog::conf_group_name,
}

if $rsyslog::manage_package {
Expand Down
6 changes: 4 additions & 2 deletions manifests/generate_concat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
if $rsyslog::manage_service or $rsyslog::external_service {
if ! defined(Concat["${confdir}/${target}"]) {
concat { "${confdir}/${target}":
owner => 'root',
owner => $rsyslog::conf_owner_name,
group => $rsyslog::conf_group_name,
notify => Service[$rsyslog::service_name],
order => 'numeric',
mode => $rsyslog::conf_permissions,
Expand All @@ -14,7 +15,8 @@
} else {
if ! defined(Concat["${confdir}/${target}"]) {
concat { "${confdir}/${target}":
owner => 'root',
owner => $rsyslog::conf_owner_name,
group => $rsyslog::conf_group_name,
order => 'numeric',
mode => $rsyslog::conf_permissions,
}
Expand Down
9 changes: 9 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#
# @param confdir
# The rsyslog configuration directory.
# @param confdir_group_name
# The rsyslog configuration directory.
# @param package_name
# The name of the rsyslog package to install.
# @param package_version
Expand Down Expand Up @@ -81,13 +83,20 @@
# Target file to insert configuration into.
# @param conf_permissions
# Set the file mode for the generated configuration files.
# @param conf_owner_name
# Set the owner for the configuration directories and related files.
# @param conf_group_name
# Set the group for the configuration files.
# @param confdir_permissions
# Set the file mode for the rsyslog.d configuration directory.
# @param global_conf_perms
# Set the file mode for the /etc/rsyslog.conf
#
class rsyslog (
String $confdir,
String $conf_owner_name,
String $conf_group_name,
String $confdir_group_name,
String $package_name,
String $package_version,
String $config_file,
Expand Down
6 changes: 6 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
"operatingsystemrelease": [
"32"
]
},
{
"operatingsystem": "Solaris",
"operatingsystemrelease": [
"11.4"
]
}
],
"dependencies": [
Expand Down