Browse Source

Merge pull request #74 from Wenzel/disable_site

add a boolean to a site configuration to enable or disable it
master
Forrest 9 years ago
parent
commit
b6437b15e0
2 changed files with 11 additions and 0 deletions
  1. +10
    -0
      apache/vhosts/standard.sls
  2. +1
    -0
      pillar.example

+ 10
- 0
apache/vhosts/standard.sls View File

- 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
- 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 %} {% endif %}


{% endfor %} {% endfor %}

+ 1
- 0
pillar.example View File

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…
Cancel
Save