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 <tonay@ibm.com>
pull/7593/head
Teoman ONAY 2024-07-11 11:35:22 +02:00
parent e85060cb67
commit 0bf3398774
1 changed files with 12 additions and 2 deletions

View File

@ -1471,8 +1471,18 @@
when: dashboard_enabled | bool when: dashboard_enabled | bool
block: block:
- name: Update the placement of alertmanager hosts - name: Update the placement of alertmanager hosts
ansible.builtin.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 }}'" ceph_orch_apply:
changed_when: false 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: environment:
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}' CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'