diff --git a/apache/vhosts/standard.sls b/apache/vhosts/standard.sls index f65fd86..823d08f 100644 --- a/apache/vhosts/standard.sls +++ b/apache/vhosts/standard.sls @@ -28,6 +28,7 @@ include: - makedirs: True {% if grains.os_family == 'Debian' %} +{% if site.get('enabled') %} a2ensite {{ id }}{{ apache.confext }}: cmd: - run @@ -36,6 +37,14 @@ a2ensite {{ id }}{{ apache.confext }}: - file: /etc/apache2/sites-available/{{ id }}{{ apache.confext }} - watch_in: - module: apache-reload +{% else %} +a2dissite {{ id }}{{ apache.confext }}: + cmd: + - run + - require: + - file: /etc/apache2/sites-available/{{ id }}{{ apache.confext }} + - watch_in: + - module: apache-reload {% endif %} {% endfor %} diff --git a/pillar.example b/pillar.example index 1cd82b5..232d2a6 100644 --- a/pillar.example +++ b/pillar.example @@ -18,6 +18,7 @@ apache: template_file: salt://apache/vhosts/minimal.tmpl example.com: # must be unique; used as an ID declaration in Salt. + enabled: True template_file: salt://apache/vhosts/standard.tmpl # or redirect.tmpl or proxy.tmpl ####################### DEFAULT VALUES BELOW ############################