Commit 7dd3b5aa authored by Eric Zillmann's avatar Eric Zillmann
Browse files

ansible-inventories/gentner#2331 proposal to require a password for a single...

ansible-inventories/gentner#2331 proposal to require a password for a single domain in multi domain environments
parent a57217ae
......@@ -130,7 +130,30 @@
{% endif %}
{% endif %}
</Directory>
{% if drupal_domain.apache_auth is defined and drupal_domain.apache_auth.location_users is defined and drupal_domain.apache_auth.active|default('true') == 'true' %}
{% if drupal_domain.apache_auth is defined and drupal_domain.apache_auth.active|default('true') == 'true' %}
{% if drupal_domain.apache_auth.domain_users is defined and drupal_domain.apache_auth.location_users is defined %}
{% for domain in drupal_domain.apache_auth.domain_users %}
<If "%{HTTP_HOST} == '{{ domain.domain }}'">
{% for location in drupal_domain.apache_auth.location_users %}
<Location {{ location.location }}>
AuthType {{ drupal_domain.apache_auth.type }}
AuthName "{{ drupal_domain.apache_auth.name }}"
AuthUserFile {{ webRoot }}/passwords/{{ drupal_domain.apache_auth.user|default(drupal.id) }}
Require user {% if location.user is defined %}{{ domain.user }}{% else %}{{ location.user }}{% endif %}
</Location>
{% endfor %}
</If>
{% endfor %}
{% elif drupal_domain.apache_auth.domain_users is defined %}
{% for domain in drupal_domain.apache_auth.domain_users %}
<If "%{HTTP_HOST} == '{{ domain.domain }}'">
AuthType {{ drupal_domain.apache_auth.type }}
AuthName "{{ drupal_domain.apache_auth.name }}"
AuthUserFile {{ webRoot }}/passwords/{{ drupal_domain.apache_auth.user|default(drupal.id) }}
Require user {{ domain.user }}
</If>
{% endfor %}
{% elif drupal_domain.apache_auth.location_users is defined %}
{% for location in drupal_domain.apache_auth.location_users %}
<Location {{ location.location }}>
AuthType {{ drupal_domain.apache_auth.type }}
......@@ -139,6 +162,7 @@
Require user {{ location.user }}
</Location>
{% endfor %}
{% endif %}
{% endif %}
<Directory {{ docRoot }}/.git/>
Require all denied
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment