Browse Source

Merge pull request #140 from Nytoca/patch-1

Proper disabling of the default vhost
master
Wolodja Wentland 8 years ago
parent
commit
eaffddb0d0
2 changed files with 6 additions and 8 deletions
  1. +4
    -4
      apache/no_default_vhost.sls
  2. +2
    -4
      apache/vhosts/standard.sls

+ 4
- 4
apache/no_default_vhost.sls View File

@@ -5,12 +5,12 @@
include:
- apache

apache_no-default-vhost:
file.absent:
- name: {{ apache.vhostdir }}/000-default.conf
a2dissite 000-default.conf:
cmd.run:
- unless: test ! -f /etc/apache2/sites-enabled/000-default.conf
- require:
- pkg: apache
- watch_in:
- module: apache-reload

{% endif %}
{% endif %}

+ 2
- 4
apache/vhosts/standard.sls View File

@@ -34,8 +34,7 @@ include:
{% if grains.os_family == 'Debian' %}
{% if site.get('enabled', True) %}
a2ensite {{ id }}{{ apache.confext }}:
cmd:
- run
cmd.run:
- unless: test -f /etc/apache2/sites-enabled/{{ id }}{{ apache.confext }}
- require:
- file: /etc/apache2/sites-available/{{ id }}{{ apache.confext }}
@@ -43,8 +42,7 @@ a2ensite {{ id }}{{ apache.confext }}:
- module: apache-reload
{% else %}
a2dissite {{ id }}{{ apache.confext }}:
cmd:
- run
cmd.run:
- onlyif: test -f /etc/apache2/sites-enabled/{{ id }}{{ apache.confext }}
- require:
- file: /etc/apache2/sites-available/{{ id }}{{ apache.confext }}

Loading…
Cancel
Save