diff --git a/README.rst b/README.rst index 83a97e6..53220ed 100644 --- a/README.rst +++ b/README.rst @@ -90,6 +90,11 @@ Enables the Apache module vhost_alias (Debian Only) Configures Apache name-based virtual hosts and creates virtual host directories using data from Pillar. +``apache.own_default_vhost`` +-------------------------- + +Replace default vhost with own version. By default, it's 503 code. (Debian Only) + Example Pillar: .. code:: yaml diff --git a/apache/files/Debian/sites-available/000-default.conf b/apache/files/Debian/sites-available/000-default.conf new file mode 100644 index 0000000..dabdf98 --- /dev/null +++ b/apache/files/Debian/sites-available/000-default.conf @@ -0,0 +1,4 @@ + + RewriteEngine on + RewriteRule ^/(.*) blah [R=503] + \ No newline at end of file diff --git a/apache/own_default_vhost.sls b/apache/own_default_vhost.sls new file mode 100644 index 0000000..add85d8 --- /dev/null +++ b/apache/own_default_vhost.sls @@ -0,0 +1,17 @@ +{% if grains['os_family']=="Debian" %} + +{% from "apache/map.jinja" import apache with context %} + +include: + - apache + +apache_own-default-vhost: + file.managed: + - name: {{ apache.vhostdir }}/000-default.conf + - source: salt://apache/files/{{ salt['grains.get']('os_family') }}/sites-available/000-default.conf + - require: + - pkg: apache + - watch_in: + - module: apache-reload + +{% endif %} \ No newline at end of file