vhosts/standard: allow user/group option

Support for DocumentRootUser and DocumentRootGroup
This commit is contained in:
Adrien "ze" Urban 2018-06-27 17:06:56 +00:00
parent dc46bc8340
commit 5211bdd72b
2 changed files with 8 additions and 0 deletions

View File

@ -27,6 +27,12 @@ include:
- unless: test -d {{ documentroot }}
- name: {{ documentroot }}
- makedirs: True
{% if site.get('DocumentRootUser') %}
- user: {{ site.DocumentRootUser }}
{% endif %}
{% if site.get('DocumentRootGroup') %}
- group: {{ site.DocumentRootGroup }}
{% endif %}
- allow_symlink: True
{% endif %}

View File

@ -71,6 +71,8 @@ apache:
CustomLog: /path/to/logs/example.com-access.log # E.g.: /var/log/apache2/example.com-access.log
DocumentRoot: /path/to/www/dir/example.com # E.g., /var/www/example.com
DocumentRootUser: www-data # Force user if specified, leave it default if not
DocumentRootGroup: www-data # Force group if specified, leave it default if not
SSLCertificateFile: /etc/ssl/mycert.pem # if ssl is desired
SSLCertificateKeyFile: /etc/ssl/mycert.pem.key # if key for cert is needed or in an extra file