Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(config): re-establish FreeBSD support #389

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apache/config/file.sls
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ include:
apache-config-file-directory-logdir:
file.directory:
- name: {{ apache.logdir }}
- user: {{ apache.user }}
- group: {{ apache.group }}
- user: {{ apache.get('logdir_user', apache.user) }}
- group: {{ apache.get('logdir_group', apache.group) }}
- makedirs: True
- require:
- sls: {{ sls_package_install }}
Expand Down Expand Up @@ -102,7 +102,7 @@ apache-config-file-managed:

apache-config-file-managed-{{ grains.os }}-env:
file.managed:
- name: /etc/apache2/envvars
- name: {{ apache.envvarsfile }}
- source: 'salt://apache/files/{{ grains.os_family }}/envvars-{{ apache.version }}.jinja'
- mode: 644
- user: {{ apache.rootuser }}
Expand Down
21 changes: 21 additions & 0 deletions apache/config/logrotate.sls
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@ apache-config-logrotate-file-managed:
/bin/systemctl reload {{ apache.service.name }}.service > /dev/null 2>/dev/null || true
endscript
}
{% elif grains.os_family == "FreeBSD" %}
- contents: |
{{ apache.logdir }}/httpd-*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
create 640 root wheel
sharedscripts
postrotate
if service {{ apache.service.name }} status >/dev/null; then \
service {{ apache.service.name }} reload >/dev/null; \
fi;
endscript
prerotate
if [ -d /usr/local/etc/logrotate.d/httpd-prerotate ]; then \
run-parts /usr/local/etc/logrotate.d/httpd-prerotate; \
fi; \
endscript
{% else %}
- contents: |
{{ apache.logdir }}/*.log {
Expand Down
1 change: 1 addition & 0 deletions apache/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ apache:
name: apache
user: www-data
group: www-data
envvarsfile: /etc/apache2/envvars
vhostdir: /etc/apache2/sites-available
confdir: /etc/apache2/conf.d
davlockdbdir: null
Expand Down
5 changes: 4 additions & 1 deletion apache/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ FreeBSD:
group: www
config: /usr/local/etc/apache24/httpd.conf
portsfile: /usr/local/etc/apache24/ports.conf
envvarsfile: /usr/local/etc/apache24/envvars.d/by_salt.env

mod_php5: mod_php56
mod_perl2: ap24-mod_perl2
Expand All @@ -203,7 +204,9 @@ FreeBSD:
default_site: default
default_site_ssl: default-ssl
moddir: /usr/local/etc/apache24/modules.d
logdir: /var/log/
logdir: /var/log
logdir_user: root
logdir_group: wheel
logrotatedir: /usr/local/etc/logrotate.d/apache2
wwwdir: /usr/local/www/apache24/

Expand Down
Loading