FreeBSD: mod_rewrite

This commit is contained in:
Alexander Weidinger 2017-01-08 12:48:42 +01:00
parent 5dbe687cda
commit f03df6e2fb
3 changed files with 18 additions and 2 deletions

View File

@ -38,7 +38,7 @@ Enables and disables Apache modules.
``apache.mod_rewrite``
----------------------
Enabled the Apache module mod_rewrite (Debian only)
Enabled the Apache module mod_rewrite (Debian and FreeBSD only)
``apache.mod_proxy``
-------------------

View File

@ -0,0 +1,3 @@
{% from "apache/map.jinja" import apache with context %}
LoadModule rewrite_module libexec/{{ apache.service }}/mod_rewrite.so

View File

@ -1,8 +1,9 @@
{% if grains['os_family']=="Debian" %}
{% from "apache/map.jinja" import apache with context %}
include:
- apache
{% if grains['os_family']=="Debian" %}
a2enmod rewrite:
cmd.run:
- unless: ls /etc/apache2/mods-enabled/rewrite.load
@ -12,4 +13,16 @@ a2enmod rewrite:
- watch_in:
- module: apache-restart
{% elif grains['os_family']=="FreeBSD" %}
{{ apache.modulesdir }}/040_mod_rewrite.conf:
file.managed:
- source: salt://apache/files/{{ salt['grains.get']('os_family') }}/mod_rewrite.conf.jinja
- mode: 644
- template: jinja
- require:
- pkg: apache
- watch_in:
- module: apache-restart
{% endif %}