From 49eb67aa84f073e3434fad11defa0bc07d710236 Mon Sep 17 00:00:00 2001 From: Grzegorz Bialas Date: Thu, 16 Apr 2026 16:30:22 +0200 Subject: Fix prometheus bootstrapping mysqld-exporter When monitoring is deployed on hosts outside of control group it will not pass service_enabled_and_mapped_to_host filter and bootstrapping step will not be executed, resulting with lack of prometheus user in mariadb. Closes-bug: #2148551 Change-Id: I520131aa976609dd2c1f5b95e4e5fc5fb8fc6e57 Signed-off-by: Grzegorz Bialas --- ansible/roles/prometheus/tasks/deploy.yml | 3 ++- .../notes/fix-bootstrapping-mysqld-exporter-f10a4ff269c2395b.yaml | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fix-bootstrapping-mysqld-exporter-f10a4ff269c2395b.yaml diff --git a/ansible/roles/prometheus/tasks/deploy.yml b/ansible/roles/prometheus/tasks/deploy.yml index 8aba64ae6..89576f144 100644 --- a/ansible/roles/prometheus/tasks/deploy.yml +++ b/ansible/roles/prometheus/tasks/deploy.yml @@ -6,7 +6,8 @@ ansible.builtin.import_tasks: check-containers.yml - name: Bootstrap prometheus service - ansible.builtin.import_tasks: bootstrap.yml + ansible.builtin.include_tasks: bootstrap.yml + when: inventory_hostname in groups['prometheus-mysqld-exporter'] - name: Flush handlers ansible.builtin.meta: flush_handlers diff --git a/releasenotes/notes/fix-bootstrapping-mysqld-exporter-f10a4ff269c2395b.yaml b/releasenotes/notes/fix-bootstrapping-mysqld-exporter-f10a4ff269c2395b.yaml new file mode 100644 index 000000000..b857b9d73 --- /dev/null +++ b/releasenotes/notes/fix-bootstrapping-mysqld-exporter-f10a4ff269c2395b.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes bootstrapping of prometheus-mysqld-exporter which is failing creating + mariadb user when monitoring group is configured to be deployed on separate + hosts. -- cgit v1.2.3