apache-formula/apache/vhosts/standard.sls
Adrien Bréfort 67e12a8bc2 Fixed Apache 2.4 support and added support for Ubuntu 14.10.
Replace require_all with use_require in map.jinja, we want to be able
to use custom Require values.

Remove uneeded Directory in standard.tmpl and add conditional and
default value for Require.

Fix bad filenames in standard.sls
2014-10-28 15:13:13 +01:00

35 lines
902 B
Plaintext

{% from "apache/map.jinja" import apache with context %}
include:
- apache
{% for id, site in salt['pillar.get']('apache:sites', {}).items() %}
{{ id }}:
file:
- managed
- name: {{ apache.vhostdir }}/{{ id }}{{ apache.confext }}
- 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
{% if grains.os_family == 'Debian' %}
a2ensite {{ id }}{{ apache.confext }}:
cmd:
- run
- unless: test -f /etc/apache2/sites-enabled/{{ id }}{{ apache.confext }}
- require:
- file: /etc/apache2/sites-available/{{ id }}{{ apache.confext }}
- watch_in:
- module: apache-reload
{% endif %}
{% endfor %}