fix(redhat): use correct vhostdir, sitesdir and logrotate script for redhat family (#376)
* fix(redhat): use correct dirs for redhat family Red hat family distributions do not implement sites-enabled nor vhosts.d directories and all virtual hosts are under /etc/httpd/conf.d Redhat based distros don't have /etc/init.d/httpd to rotate logs. Default for them uses systemctl reload to rotate logs
This commit is contained in:
parent
ea777fd102
commit
c4b8538128
@ -8,6 +8,18 @@ apache-config-logrotate-file-managed:
|
|||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ apache.logrotatedir }}
|
- name: {{ apache.logrotatedir }}
|
||||||
- makedirs: True
|
- 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: |
|
- contents: |
|
||||||
{{ apache.logdir }}/*.log {
|
{{ apache.logdir }}/*.log {
|
||||||
daily
|
daily
|
||||||
@ -29,3 +41,4 @@ apache-config-logrotate-file-managed:
|
|||||||
fi; \
|
fi; \
|
||||||
endscript
|
endscript
|
||||||
}
|
}
|
||||||
|
{% endif %}
|
||||||
|
@ -74,19 +74,19 @@ RedHat:
|
|||||||
mod_geoip: mod_geoip
|
mod_geoip: mod_geoip
|
||||||
mod_geoip_database: GeoIP
|
mod_geoip_database: GeoIP
|
||||||
|
|
||||||
vhostdir: /etc/httpd/vhosts.d
|
vhostdir: /etc/httpd/conf.d
|
||||||
confdir: /etc/httpd/conf.d
|
confdir: /etc/httpd/conf.d
|
||||||
modulesdir: /usr/lib64/httpd/modules
|
modulesdir: /usr/lib64/httpd/modules
|
||||||
confext: .conf
|
confext: .conf
|
||||||
default_site: default
|
default_site: default
|
||||||
default_site_ssl: default-ssl
|
default_site_ssl: ssl
|
||||||
logdir: /var/log/httpd
|
logdir: /var/log/httpd
|
||||||
logrotatedir: /etc/logrotate.d/httpd
|
logrotatedir: /etc/logrotate.d/httpd
|
||||||
wwwdir: /var/www
|
wwwdir: /var/www
|
||||||
default_charset: UTF-8
|
default_charset: UTF-8
|
||||||
use_require: false
|
use_require: false
|
||||||
moddir: /etc/httpd/conf.modules.d
|
moddir: /etc/httpd/conf.modules.d
|
||||||
sitesdir: /etc/httpd/sites-enabled
|
sitesdir: /etc/httpd/conf.d
|
||||||
|
|
||||||
Suse:
|
Suse:
|
||||||
pkg:
|
pkg:
|
||||||
|
@ -16,10 +16,10 @@ control 'apache configuration' do
|
|||||||
moddir = '/etc/apache2/mods-enabled'
|
moddir = '/etc/apache2/mods-enabled'
|
||||||
sitesdir = '/etc/apache2/vhosts.d'
|
sitesdir = '/etc/apache2/vhosts.d'
|
||||||
when 'redhat', 'fedora'
|
when 'redhat', 'fedora'
|
||||||
vhostdir = '/etc/httpd/vhosts.d'
|
vhostdir = '/etc/httpd/conf.d'
|
||||||
logrotatedir = '/etc/logrotate.d/httpd'
|
logrotatedir = '/etc/logrotate.d/httpd'
|
||||||
moddir = '/etc/httpd/conf.modules.d'
|
moddir = '/etc/httpd/conf.modules.d'
|
||||||
sitesdir = '/etc/httpd/sites-enabled'
|
sitesdir = '/etc/httpd/conf.d'
|
||||||
when 'gentoo'
|
when 'gentoo'
|
||||||
vhostdir = '/etc/apache2/vhosts.d'
|
vhostdir = '/etc/apache2/vhosts.d'
|
||||||
logrotatedir = '/etc/logrotate.d/apache2'
|
logrotatedir = '/etc/logrotate.d/apache2'
|
||||||
|
@ -18,11 +18,11 @@ control 'apache configuration' do
|
|||||||
moddir = '/etc/apache2/mods-enabled'
|
moddir = '/etc/apache2/mods-enabled'
|
||||||
sitesdir = '/etc/apache2/vhosts.d'
|
sitesdir = '/etc/apache2/vhosts.d'
|
||||||
when 'redhat', 'fedora'
|
when 'redhat', 'fedora'
|
||||||
vhostdir = '/etc/httpd/vhosts.d'
|
vhostdir = '/etc/httpd/conf.d'
|
||||||
logrotatedir = '/etc/logrotate.d/httpd'
|
logrotatedir = '/etc/logrotate.d/httpd'
|
||||||
logdir = '/var/log/httpd'
|
logdir = '/var/log/httpd'
|
||||||
moddir = '/etc/httpd/conf.modules.d'
|
moddir = '/etc/httpd/conf.modules.d'
|
||||||
sitesdir = '/etc/httpd/sites-enabled'
|
sitesdir = '/etc/httpd/conf.d'
|
||||||
apachectl = 'httpd -t'
|
apachectl = 'httpd -t'
|
||||||
when 'gentoo'
|
when 'gentoo'
|
||||||
vhostdir = '/etc/apache2/vhosts.d'
|
vhostdir = '/etc/apache2/vhosts.d'
|
||||||
|
Loading…
Reference in New Issue
Block a user