matrix-docker-ansible-deploy/roles/custom/matrix-prometheus-nginxlog-exporter/tasks/validate_config.yml
Suguru Hirahara 6acf82a3ef
Add license information to files for matrix-prometheus-nginxlog-exporter
This commit adds copyright attributions in SPDX to the files for prometheus-nginxlog-exporter, following REUSE's specification.

Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2025-02-26 15:52:54 +09:00

44 lines
2.2 KiB
YAML

# SPDX-FileCopyrightText: 2022 MDAD project contributors
# SPDX-FileCopyrightText: 2023 - 2024 Slavi Pantaleev
#
# SPDX-License-Identifier: AGPL-3.0-or-later
---
- name: (Deprecation) Catch and report renamed prometheus-nginxlog-exporter settings
ansible.builtin.fail:
msg: >-
Your configuration contains a variable, which now has a different name.
Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
when: "item.old in vars"
with_items:
- {'old': 'matrix_prometheus_nginxlog_exporter_container_hostname', 'new': 'matrix_prometheus_nginxlog_exporter_identifier'}
- {'old': 'matrix_prometheus_nginxlog_exporter_docker_image_name_prefix', 'new': 'matrix_prometheus_nginxlog_exporter_docker_image_registry_prefix'}
- 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 required prometheus-nginxlog-exporter settings not defined
ansible.builtin.fail:
msg: >-
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- {'name': 'matrix_prometheus_nginxlog_exporter_metrics_proxying_hostname', when: "{{ matrix_prometheus_nginxlog_exporter_metrics_proxying_enabled }}"}
- {'name': 'matrix_prometheus_nginxlog_exporter_metrics_proxying_path_prefix', when: "{{ matrix_prometheus_nginxlog_exporter_metrics_proxying_enabled }}"}
- {'name': 'matrix_prometheus_nginxlog_exporter_container_network', when: true}