Skip to content

Commit aaa728e

Browse files
author
adam
committed
feat: allow overriding document_root #15
1 parent 19836bc commit aaa728e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

defaults/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# apache2_sites:
1515
# - id: mysite (required)
1616
# name: mysite.local (required)
17+
# document_root: ""
1718
# ip: '*'
1819
# port: 80
1920
# state: present

templates/etc/apache2/sites-available/site/body.j2

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
ServerName {{ item.name }}
2+
{% if item.document_root is defined %}
3+
DocumentRoot {{ item.document_root }}
4+
{% else %}
25
DocumentRoot {{ apache2_sites_basedir }}/{{ item.id }}/htdocs
6+
{% endif %}
37
{% for value in item.aliases|default([]) %}
48
ServerAlias {{ value }}
59
{% endfor %}

0 commit comments

Comments
 (0)