From c114822a81bab19063e4991fb24e2001eb599da5 Mon Sep 17 00:00:00 2001 From: Teoman ONAY Date: Thu, 11 Jul 2024 11:35:22 +0200 Subject: [PATCH] cephadm-adopt: Fixes binding network for alertmanager Alertmanager was bind to default * network instead of grafana_server_addr as it was before. Now on if grafana_server_addr is defined, it will be bind to that network. Signed-off-by: Teoman ONAY (cherry picked from commit 0bf3398774dda6683f74a48f0ff3b26be6acec5a) --- infrastructure-playbooks/cephadm-adopt.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/infrastructure-playbooks/cephadm-adopt.yml b/infrastructure-playbooks/cephadm-adopt.yml index 08f5c4393..0ce7bb9b7 100644 --- a/infrastructure-playbooks/cephadm-adopt.yml +++ b/infrastructure-playbooks/cephadm-adopt.yml @@ -1516,9 +1516,19 @@ - name: with dashboard enabled when: dashboard_enabled | bool block: - - name: update the placement of alertmanager hosts - command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply alertmanager --placement='{{ groups.get(monitoring_group_name, []) | length }} label:{{ monitoring_group_name }}'" - changed_when: false + - name: Update the placement of alertmanager hosts + ceph_orch_apply: + fsid: "{{ fsid }}" + spec: | + service_type: alertmanager + service_id: "{{ ansible_facts['hostname'] }}" + placement: + label: "{{ monitoring_group_name }}" + {% if grafana_server_addr is defined %} + networks: + - {{ grafana_server_addr }} + {% endif %} + delegate_to: "{{ groups[mon_group_name][0] }}" environment: CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'