From 16597c16d5428c464d587e0600fcd8fe013e82f9 Mon Sep 17 00:00:00 2001 From: 12ww1160 <12ww1160@confdroid.com> Date: Sun, 4 Oct 2026 12:19:36 +0200 Subject: [PATCH] OP#830 add logrotation file --- manifests/main/files.pp | 11 +++++++++++ manifests/params.pp | 2 ++ templates/logrotate.chrony.erb | 9 +++++++++ 3 files changed, 22 insertions(+) create mode 100644 templates/logrotate.chrony.erb diff --git a/manifests/main/files.pp b/manifests/main/files.pp index c5db453..6fb65c2 100644 --- a/manifests/main/files.pp +++ b/manifests/main/files.pp @@ -35,4 +35,15 @@ class confdroid_ntp::main::files ( } # log rotation + file { $cy_logrotate_file: + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + selrange => s0, + selrole => object_r, + seltype => etc_t, + seluser => system_u, + content => template($cy_logrotate_erb), + } } diff --git a/manifests/params.pp b/manifests/params.pp index ca786ec..3047f78 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -48,6 +48,8 @@ class confdroid_ntp::params ( $cy_conf_file = '/etc/chrony.conf' $cy_conf_erb = 'confdroid_ntp/chrony.conf.erb' $cy_drift_file = '/var/lib/chrony/drift' + $cy_logrotate_file = '/etc/logrotate.d/chrony' + $cy_logrotate_erb = 'confdroid_ntp/logrotate.chrony.erb' # service $cy_service = 'chronyd' diff --git a/templates/logrotate.chrony.erb b/templates/logrotate.chrony.erb new file mode 100644 index 0000000..6ddeab9 --- /dev/null +++ b/templates/logrotate.chrony.erb @@ -0,0 +1,9 @@ +# file created by Puppet, manual changes will be overwritten +/var/log/chrony/*.log { + missingok + nocreate + sharedscripts + postrotate + /usr/bin/chronyc cyclelogs > /dev/null 2>&1 || true + endscript +}