Browse Source

fix(redhat): use correct logrotate config on redhat family distros

Redhat based distros don't have /etc/init.d/httpd to rotate logs.
Default for them uses systemctl reload to rotate logs
pull/376/head
l00d3r 3 years ago
parent
commit
f96cd02e55
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      apache/config/logrotate.sls

+ 13
- 0
apache/config/logrotate.sls View File

@@ -8,6 +8,18 @@ apache-config-logrotate-file-managed:
file.managed:
- name: {{ apache.logrotatedir }}
- makedirs: True
{%- if grains.os_family == "RedHat" %}
- contents: |
{{ apache.logdir }}/*log {
missingok
notifempty
sharedscripts
delaycompress
postrotate
/bin/systemctl reload {{ apache.service.name }}.service > /dev/null 2>/dev/null || true
endscript
}
{% else %}
- contents: |
{{ apache.logdir }}/*.log {
daily
@@ -29,3 +41,4 @@ apache-config-logrotate-file-managed:
fi; \
endscript
}
{% endif %}

Loading…
Cancel
Save