1
0
mirror of https://github.com/spantaleev/matrix-docker-ansible-deploy.git synced 2024-12-12 08:43:55 +02:00
matrix-docker-ansible-deploy/roles/custom/matrix-prometheus-nginxlog-exporter/tasks/validate_config.yml
ikkemaniac 8ebf18a885
add prometheus-nginxlog-exporter role (#2315)
* add prometheus-nginxlog-exporter role

* Rename matrix_prometheus_nginxlog_exporter_container_url to matrix_prometheus_nginxlog_exporter_container_hostname

* avoid referencing variables from other roles, handover info using group_vars/matrix_servers

* fix: stop service when uninstalling

fix: typo

move available arch's into a var

fix: text

* fix: prometheus enabled condition

Co-authored-by: ikkemaniac <ikkemaniac@localhost>
2022-12-07 16:58:36 +02:00

33 lines
1.5 KiB
YAML

---
- name: Fail if Prometheus not enabled
ansible.builtin.fail:
msg: >
You need to set `matrix_prometheus_enabled: true` or configure an external Prometheus database
as this roles requires Prometheus for data storage.
when: not matrix_prometheus_enabled and not matrix_prometheus_nginxlog_exporter_metrics_proxying_enabled
- name: Fail if docker image not availble for arch
ansible.builtin.fail:
msg: >
'prometheus-nginxlog-exporter' docker image is not available for your arch '{{ matrix_architecture }}'.
We currently do not support building an image using this playbook.
You can use a custom-build image by setting
'matrix_prometheus_nginxlog_exporter_docker_image_arch_check_enabled: false'
'matrix_prometheus_nginxlog_exporter_docker_image: path/to/docker/image:tag'
or disable 'prometheus-nginxlog-exporter' by setting
'matrix_prometheus_nginxlog_exporter: false'
in vars.yml
when: matrix_prometheus_nginxlog_exporter_docker_image_arch_check_enabled and matrix_architecture not in matrix_prometheus_nginxlog_exporter_docker_image_arch
- name: Fail if nginx-proxy is not set to proxy metrics while prometheus-nginxlog-exporter is
ansible.builtin.fail:
msg: >
'matrix_prometheus_nginxlog_exporter_metrics_proxying_enabled' is set but 'matrix_nginx_proxy_proxy_matrix_metrics_enabled' is not
when: matrix_prometheus_nginxlog_exporter_metrics_proxying_enabled | bool and not matrix_nginx_proxy_proxy_matrix_metrics_enabled | bool