2013-09-03 21:28:00 +02:00
|
|
|
{% 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 }}
|
|
|
|
- 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:
|
2014-01-04 12:59:39 +01:00
|
|
|
- module: apache-reload
|
2013-08-28 00:27:01 +02:00
|
|
|
|
|
|
|
{% if grains.os_family == 'Debian' %}
|
|
|
|
a2ensite {{ id }}:
|
|
|
|
cmd:
|
|
|
|
- run
|
|
|
|
- require:
|
|
|
|
- file: {{ id }}
|
2013-11-05 20:34:06 +01:00
|
|
|
- watch_in:
|
|
|
|
- cmd: apache-reload
|
2013-08-28 00:27:01 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% endfor %}
|