Browse Source

fix(suse): skip service

SUSE based distributions do not use Cron, but instead a systemd
timer for running logrotate on a schedule.
As this timer is enabled through a systemd preset, skip the state
completely.

Signed-off-by: Georg Pfuetzenreuter <georg.pfuetzenreuter@suse.com>
pull/71/head
Georg Pfuetzenreuter 4 months ago
parent
commit
26f74e58ac
No account linked to committer's email address
3 changed files with 7 additions and 0 deletions
  1. +1
    -0
      logrotate/osfamilymap.yaml
  2. +4
    -0
      logrotate/service.sls
  3. +2
    -0
      test/integration/default/controls/base.rb

+ 1
- 0
logrotate/osfamilymap.yaml View File

default_config: default_config:
dateext: true dateext: true
Suse: Suse:
service: null
login_records_jobs: false login_records_jobs: false
default_config: default_config:
dateext: true dateext: true

+ 4
- 0
logrotate/service.sls View File



{% from "logrotate/map.jinja" import logrotate with context %} {% from "logrotate/map.jinja" import logrotate with context %}


{%- if logrotate.service is not none %}

include: include:
- logrotate.config - logrotate.config
- logrotate.install - logrotate.install
- pkg: logrotate-pkg - pkg: logrotate-pkg
- file: logrotate-config - file: logrotate-config
- file: logrotate-directory - file: logrotate-directory

{%- endif %}

+ 2
- 0
test/integration/default/controls/base.rb View File

'cronie' 'cronie'
when 'redhat', 'fedora' when 'redhat', 'fedora'
'crond' 'crond'
when 'suse'
'logrotate.timer'
else else
'cron' 'cron'
end end

Loading…
Cancel
Save