Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

36 строки
1.9 KiB

  1. ---
  2. - name: Fail if matrix-nginx-proxy role already executed
  3. ansible.builtin.fail:
  4. msg: >-
  5. Trying to append postgres-exporter's reverse-proxying configuration to matrix-nginx-proxy,
  6. but it's pointless since the matrix-nginx-proxy role had already executed.
  7. To fix this, please change the order of roles in your playbook,
  8. so that the matrix-nginx-proxy role would run after the matrix-prometheus-postgres-exporter role.
  9. when: matrix_nginx_proxy_role_executed | default(False) | bool
  10. - name: Generate postgres-exporter metrics proxying configuration for matrix-nginx-proxy (matrix.DOMAIN/metrics/postgres-exporter)
  11. ansible.builtin.set_fact:
  12. matrix_prometheus_postgres_exporter_nginx_metrics_configuration_block: |
  13. location /metrics/postgres-exporter {
  14. {% if matrix_nginx_proxy_enabled | default(False) %}
  15. {# Use the embedded DNS resolver in Docker containers to discover the service #}
  16. resolver 127.0.0.11 valid=5s;
  17. set $backend "matrix-prometheus-postgres-exporter:9187";
  18. proxy_pass http://$backend/metrics;
  19. {% elif matrix_prometheus_postgres_exporter_matrix_nginx_proxy_not_enabled_proxy_pass_host != '' %}
  20. proxy_pass http://{{ matrix_prometheus_postgres_exporter_matrix_nginx_proxy_not_enabled_proxy_pass_host }}/metrics;
  21. {% else %}
  22. return 404 "matrix-nginx-proxy is disabled and no host port was bound to the container, so metrics are unavailable";
  23. {% endif %}
  24. }
  25. - name: Register postgres-exporter metrics proxying configuration with matrix-nginx-proxy (matrix.DOMAIN/metrics/postgres-exporter)
  26. ansible.builtin.set_fact:
  27. matrix_nginx_proxy_proxy_matrix_metrics_additional_system_location_configuration_blocks: |
  28. {{
  29. matrix_nginx_proxy_proxy_matrix_metrics_additional_system_location_configuration_blocks | default([])
  30. +
  31. [matrix_prometheus_postgres_exporter_nginx_metrics_configuration_block]
  32. }}