add an 'enabled' attribute for a site in pillar
This commit is contained in:
parent
25179778ed
commit
c195dce07c
@ -28,6 +28,7 @@ include:
|
|||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
{% if grains.os_family == 'Debian' %}
|
{% if grains.os_family == 'Debian' %}
|
||||||
|
{% if site.get('enabled') %}
|
||||||
a2ensite {{ id }}{{ apache.confext }}:
|
a2ensite {{ id }}{{ apache.confext }}:
|
||||||
cmd:
|
cmd:
|
||||||
- run
|
- run
|
||||||
@ -36,6 +37,14 @@ a2ensite {{ id }}{{ apache.confext }}:
|
|||||||
- file: /etc/apache2/sites-available/{{ id }}{{ apache.confext }}
|
- file: /etc/apache2/sites-available/{{ id }}{{ apache.confext }}
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- module: apache-reload
|
- 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 %}
|
{% endfor %}
|
||||||
|
@ -18,6 +18,7 @@ apache:
|
|||||||
template_file: salt://apache/vhosts/minimal.tmpl
|
template_file: salt://apache/vhosts/minimal.tmpl
|
||||||
|
|
||||||
example.com: # must be unique; used as an ID declaration in Salt.
|
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
|
template_file: salt://apache/vhosts/standard.tmpl # or redirect.tmpl or proxy.tmpl
|
||||||
|
|
||||||
####################### DEFAULT VALUES BELOW ############################
|
####################### DEFAULT VALUES BELOW ############################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user