Switch from matrix-prometheus-postgres-exporter to an external prometheus_postgres_exporter role

This commit is contained in:
Slavi Pantaleev
2023-02-05 10:32:09 +02:00
parent 2d7d5d4bab
commit be78b74fbd
18 changed files with 123 additions and 254 deletions

View File

@ -2,3 +2,6 @@
# Controls if (`matrix_prometheus_node_exporter` -> `prometheus_node_exporter`) validation will run.
matrix_playbook_migration_matrix_prometheus_node_exporter_migration_validation_enabled: true
# Controls if (`matrix_prometheus_postgres_exporter` -> `prometheus_postgres_exporter`) validation will run.
matrix_playbook_migration_matrix_prometheus_postgres_exporter_migration_validation_enabled: true

View File

@ -35,6 +35,7 @@
- {'old': 'matrix_common_after_systemd_service_start_wait_for_timeout_seconds', 'new': 'devture_systemd_service_manager_up_verification_delay_seconds'}
- {'old': 'matrix_systemd_services_autostart_enabled', 'new': 'devture_systemd_service_manager_services_autostart_enabled'}
- {'old': 'matrix_prometheus_node_exporter_metrics_proxying_enabled', 'new': 'matrix_prometheus_services_proxy_connect_prometheus_node_exporter_metrics_proxying_enabled'}
- {'old': 'matrix_prometheus_postgres_exporter_metrics_proxying_enabled', 'new': 'matrix_prometheus_services_proxy_connect_prometheus_postgres_exporter_metrics_proxying_enabled'}
- name: (Deprecation) Catch and report matrix_postgres variables
ansible.builtin.fail:
@ -64,3 +65,18 @@
Please change your configuration (vars.yml) to rename all variables (`matrix_prometheus_node_exporter_` -> `prometheus_node_exporter_`).
We found usage of the following variables: {{ matrix_playbook_migration_matrix_prometheus_node_exporter_migration_vars.keys() | join(', ') }}
when: "matrix_playbook_migration_matrix_prometheus_node_exporter_migration_vars | length > 0"
- when: matrix_playbook_migration_matrix_prometheus_postgres_exporter_migration_validation_enabled | bool
block:
- ansible.builtin.set_fact:
matrix_playbook_migration_matrix_prometheus_postgres_exporter_migration_vars: |-
{{ vars | dict2items | selectattr('key', 'match', 'matrix_prometheus_postgres_exporter_.*') | list | items2dict }}
- name: (Deprecation) Catch and report matrix_prometheus_postgres_exporter variables
ansible.builtin.fail:
msg: >-
The matrix-prometheus-postgres-exporter role that used to be part of this playbook has been replaced by https://gitlab.com/etke.cc/roles/prometheus_postgres_exporter.
The new role is compatible with the old one, but uses different names for its variables.
Please change your configuration (vars.yml) to rename all variables (`matrix_prometheus_postgres_exporter_` -> `prometheus_postgres_exporter_`).
We found usage of the following variables: {{ matrix_playbook_migration_matrix_prometheus_postgres_exporter_migration_vars.keys() | join(', ') }}
when: "matrix_playbook_migration_matrix_prometheus_postgres_exporter_migration_vars | length > 0"