Allow additional volumes to be mounted into matrix-nginx-proxy

Certain use-cases may require that people mount additional files
into the matrix-nginx-proxy container. Similarly to how we do it
for Synapse, we are introducing a new variable that makes this
possible (`matrix_nginx_proxy_container_additional_volumes`).

This makes the htpasswd file for Synapse Metrics (introduced in #86,
Github Pull Request) to also perform mounting using this new mechanism.
Hopefully, for such an "extension", keeping htpasswd file-creation and
volume definition in the same place (the tasks file) is better.

All other major volumes' mounting mechanism remains the same (explicit
mounting).
This commit is contained in:
Slavi Pantaleev
2019-02-05 11:46:16 +02:00
parent 9a251e4e46
commit 96afbbb5af
3 changed files with 17 additions and 3 deletions

View File

@ -37,6 +37,14 @@
mode: 0400
when: "matrix_nginx_proxy_proxy_synapse_metrics_basic_auth_enabled and matrix_nginx_proxy_proxy_synapse_metrics"
- name: Ensure matrix-synapse-metrics-htpasswd is mounted into the matrix-nginx-proxy container
- set_fact:
matrix_nginx_proxy_container_additional_volumes: >
{{ matrix_nginx_proxy_container_additional_volumes }}
+
{{ [{'src': '{{ matrix_nginx_proxy_data_path }}/matrix-synapse-metrics-htpasswd', 'dst': '/etc/nginx/.matrix-synapse-metrics-htpasswd', 'options': 'ro'}] }}
when: "matrix_nginx_proxy_proxy_synapse_metrics_basic_auth_enabled and matrix_nginx_proxy_proxy_synapse_metrics"
- name: Ensure Matrix nginx-proxy configured (generic)
template:
src: "{{ role_path }}/templates/nginx/conf.d/nginx-http.conf.j2"