diff --git a/README.rst b/README.rst index 90a3976..9caf445 100644 --- a/README.rst +++ b/README.rst @@ -43,7 +43,7 @@ Enabled the Apache module mod_rewrite (Debian only) ``apache.mod_proxy`` ------------------- -Enables the Apache module mod_proxy. (Debian only) +Enables the Apache module mod_proxy. (Debian and FreeBSD only) ``apache.mod_proxy_http`` ------------------------- diff --git a/apache/files/FreeBSD/mod_php5.conf.jinja b/apache/files/FreeBSD/mod_php5.conf.jinja index fd39fc8..7281a72 100644 --- a/apache/files/FreeBSD/mod_php5.conf.jinja +++ b/apache/files/FreeBSD/mod_php5.conf.jinja @@ -1,4 +1,6 @@ -LoadModule php5_module /usr/local/libexec/apache24/libphp5.so +{% from "apache/map.jinja" import apache with context %} + +LoadModule php5_module /usr/local/libexec/{{ apache.service }}/libphp5.so DirectoryIndex index.html index.php diff --git a/apache/files/FreeBSD/mod_proxy.conf.jinja b/apache/files/FreeBSD/mod_proxy.conf.jinja new file mode 100644 index 0000000..659957e --- /dev/null +++ b/apache/files/FreeBSD/mod_proxy.conf.jinja @@ -0,0 +1,3 @@ +{% from "apache/map.jinja" import apache with context %} + +LoadModule proxy_module libexec/{{ apache.service }}/mod_proxy.so diff --git a/apache/mod_proxy.sls b/apache/mod_proxy.sls index f05419e..ee6ad80 100644 --- a/apache/mod_proxy.sls +++ b/apache/mod_proxy.sls @@ -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 mod_proxy: cmd.run: - name: a2enmod proxy @@ -13,4 +14,15 @@ a2enmod mod_proxy: - watch_in: - module: apache-restart +{% elif grains['os_family']=="FreeBSD" %} +{{ apache.modulesdir }}/040_mod_proxy.conf: + file.managed: + - source: salt://apache/files/{{ salt['grains.get']('os_family') }}/mod_proxy.conf.jinja + - mode: 644 + - template: jinja + - require: + - pkg: apache + - watch_in: + - module: apache-restart + {% endif %}