Merge pull request #74 from Wenzel/disable_site

add a boolean to a site configuration to enable or disable it
This commit is contained in:
Forrest 2015-08-25 11:02:29 -07:00
commit b6437b15e0
2 changed files with 11 additions and 0 deletions

View File

@ -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,15 @@ 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 %}
{% endif %}
{% endfor %}

View File

@ -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 ############################