From 087f73b5c34b887fd774bda4251c5084d6631679 Mon Sep 17 00:00:00 2001 From: Hendrik Jäger Date: Wed, 4 May 2022 20:49:32 +0200 Subject: rotate logs of system services, but not user services --- manifests/config.pp | 16 ++++++++++++++++ manifests/init.pp | 3 +++ manifests/service.pp | 5 +++++ 3 files changed, 24 insertions(+) create mode 100644 manifests/config.pp (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp new file mode 100644 index 0000000..85a0831 --- /dev/null +++ b/manifests/config.pp @@ -0,0 +1,16 @@ +class s6::config { + $basedir = '/etc/s6-services/s6-logrotater' + + file { + $basedir: + ensure => directory, + mode => '0600', + ; + + "${basedir}/run": + ensure => present, + content => epp("s6/${basedir}/run.epp"), + mode => '0700', + ; + } +} diff --git a/manifests/init.pp b/manifests/init.pp index cd36656..3141174 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -5,6 +5,9 @@ class s6 { "${name}::install": notify => Class["${name}::service"], ; + "${name}::config": + notify => Class["${name}::service"], + ; "${name}::service": ; } } diff --git a/manifests/service.pp b/manifests/service.pp index 0e90664..92e13c9 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -4,5 +4,10 @@ class s6::service { ensure => running, enable => true, ; + 's6-logrotater': + ensure => running, + enable => true, + provider => 's6', + ; } } -- cgit v1.2.3