Elukey has submitted this change and it was merged.

Change subject: Add documentation to systemd::syslog and an optional filepath 
variable
......................................................................


Add documentation to systemd::syslog and an optional filepath variable

Change-Id: I7f10206ae6015991c075d45b2a7cb9a502911141
---
M modules/systemd/manifests/syslog.pp
1 file changed, 40 insertions(+), 8 deletions(-)

Approvals:
  Elukey: Looks good to me, approved
  Mobrovac: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/systemd/manifests/syslog.pp 
b/modules/systemd/manifests/syslog.pp
index 5a468c0..f65e35f 100644
--- a/modules/systemd/manifests/syslog.pp
+++ b/modules/systemd/manifests/syslog.pp
@@ -1,8 +1,40 @@
+# === Define: systemd::syslog
+#
+# Configures logging via rsyslog and logrotate for systemd units.
+# Use the SyslogIdentifier parameter in the service's unit file
+# if firejail (or similar) is used otherwise rsyslog will not receive
+# the right program name.
+#
+# === Parameters
+#
+# [*base_dir*]
+#   Base path, 'title' will be appended to form the final directory path.
+#   For example: $title => 'servicebla', log dir => '/var/log/servicebla'
+#   Default: '/var/log'
+#
+# [*owner*]
+#   User owner of the logging directory.
+#   Default: $title
+#
+# [*group*]
+#   Group owner of the logging directory.
+#   Default: $title
+#
+# [*readable_by*]
+#   Establish the file permissions assigned to the logging directory.
+#   Options available: 'user' (0600), 'group' (0640), all '0644'
+#   Default: 'group'
+#
+# [*log_filename*]
+#   Filename of the logging file.
+#   Default: 'syslog.log'
+#
 define systemd::syslog(
-    $base_dir='/var/log',
-    $owner=$title,
-    $group=$title,
-    $readable_by='group'
+    $base_dir     = '/var/log',
+    $owner        = $title,
+    $group        = $title,
+    $readable_by  = 'group',
+    $log_filename = 'syslog.log'
     ) {
     if $::initsystem != 'systemd' {
         fail('systemd::syslog is useful only with systemd')
@@ -11,13 +43,13 @@
     # File permissions
     $dirmode = '0755'
     $filemode = $readable_by ? {
-        'user' => '0600',
-        'group' =>'0640',
-        'all' => '0644'
+        'user'  => '0600',
+        'group' => '0640',
+        'all'   => '0644'
     }
 
     $local_logdir = "${base_dir}/${title}"
-    $local_syslogfile = "${local_logdir}/syslog.log"
+    $local_syslogfile = "${local_logdir}/${log_filename}"
 
     if ! defined(File[$local_logdir]) {
         file { $local_logdir:

-- 
To view, visit https://gerrit.wikimedia.org/r/315122
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7f10206ae6015991c075d45b2a7cb9a502911141
Gerrit-PatchSet: 8
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Elukey <ltosc...@wikimedia.org>
Gerrit-Reviewer: Elukey <ltosc...@wikimedia.org>
Gerrit-Reviewer: Mobrovac <mobro...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to