Explorar el Código

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 hace 3 años
padre
commit
f96cd02e55
Se han modificado 1 ficheros con 13 adiciones y 0 borrados
  1. +13
    -0
      apache/config/logrotate.sls

+ 13
- 0
apache/config/logrotate.sls Ver fichero

@@ -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 %}

Cargando…
Cancelar
Guardar