apache-formula/apache/vhosts/standard.sls

35 lines
813 B
Plaintext
Raw Normal View History

{% from "apache/map.jinja" import apache with context %}
2013-08-28 00:27:01 +02:00
include:
- apache
{% for id, site in salt['pillar.get']('apache:sites', {}).items() %}
{{ id }}:
file:
- managed
- name: {{ apache.vhostdir }}/{{ id }}{{ apache.confext }}
2013-08-28 00:27:01 +02:00
- source: {{ site.get('template_file', 'salt://apache/vhosts/standard.tmpl') }}
- template: {{ site.get('template_engine', 'jinja') }}
- context:
id: {{ id|json }}
site: {{ site|json }}
map: {{ apache|json }}
- require:
- pkg: apache
- watch_in:
- module: apache-reload
2013-08-28 00:27:01 +02:00
{% if grains.os_family == 'Debian' %}
a2ensite {{ id }}:
cmd:
- run
2014-08-01 15:32:40 +02:00
- unless: test -f /etc/apache2/sites-enabled/{{ id }}
2013-08-28 00:27:01 +02:00
- require:
- file: {{ id }}
- watch_in:
- module: apache-reload
2013-08-28 00:27:01 +02:00
{% endif %}
{% endfor %}