|
|
|
|
|
|
|
|
- apache |
|
|
- apache |
|
|
|
|
|
|
|
|
{% for id, site in salt['pillar.get']('apache:sites', {}).items() %} |
|
|
{% for id, site in salt['pillar.get']('apache:sites', {}).items() %} |
|
|
|
|
|
{% set documentroot = site.get('DocumentRoot', '{0}/{1}'.format(apache.wwwdir, sitename)) %} |
|
|
|
|
|
|
|
|
{{ id }}: |
|
|
{{ id }}: |
|
|
file: |
|
|
file: |
|
|
|
|
|
|
|
|
- watch_in: |
|
|
- watch_in: |
|
|
- module: apache-reload |
|
|
- module: apache-reload |
|
|
|
|
|
|
|
|
{% if 'DocumentRoot' in site %} |
|
|
|
|
|
{{ id }}-documentroot: |
|
|
{{ id }}-documentroot: |
|
|
file.directory: |
|
|
file.directory: |
|
|
- unless: test -d {{ site.get('DocumentRoot') }} |
|
|
|
|
|
- name: {{ site.get('DocumentRoot') }} |
|
|
|
|
|
|
|
|
- unless: test -d {{ documentroot }} |
|
|
|
|
|
- name: {{ documentroot }} |
|
|
- makedirs: True |
|
|
- makedirs: True |
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
|
|
{% if grains.os_family == 'Debian' %} |
|
|
{% if grains.os_family == 'Debian' %} |
|
|
a2ensite {{ id }}{{ apache.confext }}: |
|
|
a2ensite {{ id }}{{ apache.confext }}: |