From 5e7cefff332866adfa2e061a5dd1b09d409b7740 Mon Sep 17 00:00:00 2001 From: Teoman ONAY Date: Wed, 2 Oct 2024 16:36:31 +0200 Subject: [PATCH 1/2] cephadm-adopt: custom prometheus port lost after adoption If a custom Prometheus port was used before adoption, it was not taken into account and default 9095 was set instead. Now custom port is re-applied. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2242346 Signed-off-by: Teoman ONAY (cherry picked from commit b41b7bf869982a82d9ddddcef714a672c530b6f7) # Conflicts: # infrastructure-playbooks/cephadm-adopt.yml --- infrastructure-playbooks/cephadm-adopt.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/infrastructure-playbooks/cephadm-adopt.yml b/infrastructure-playbooks/cephadm-adopt.yml index 282514ad41..859eacd1ce 100644 --- a/infrastructure-playbooks/cephadm-adopt.yml +++ b/infrastructure-playbooks/cephadm-adopt.yml @@ -1542,8 +1542,24 @@ environment: CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}' +<<<<<<< HEAD - name: update the placement of prometheus hosts command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply prometheus --placement='{{ groups.get(monitoring_group_name, []) | length }} label:{{ monitoring_group_name }}'" +======= + - name: Update the placement of prometheus hosts + ceph_orch_apply: + fsid: "{{ fsid }}" + spec: | + service_name: prometheus + service_id: "{{ ansible_facts['hostname'] }}" + placement: + label: {{ monitoring_group_name }} + count: {{ groups.get(monitoring_group_name, []) | length }} + {% if prometheus_port is defined and prometheus_port != 9095 %} + spec: + port: {{ prometheus_port }} + {% endif %} +>>>>>>> b41b7bf86 (cephadm-adopt: custom prometheus port lost after adoption) changed_when: false environment: CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}' From f8bd922265874679d8c50eeb9da8703a46036a72 Mon Sep 17 00:00:00 2001 From: Teoman ONAY Date: Wed, 2 Oct 2024 16:43:39 +0200 Subject: [PATCH 2/2] ephadm-adopt: Alertmanager placement count missing Regression from #7576. Alertmanager placement count was missing after migration to ceph_orch_apply module Signed-off-by: Teoman ONAY (cherry picked from commit 31be49506118ece75371d0c86af794caee8bc051) --- infrastructure-playbooks/cephadm-adopt.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/infrastructure-playbooks/cephadm-adopt.yml b/infrastructure-playbooks/cephadm-adopt.yml index 859eacd1ce..5b48952961 100644 --- a/infrastructure-playbooks/cephadm-adopt.yml +++ b/infrastructure-playbooks/cephadm-adopt.yml @@ -1517,8 +1517,8 @@ environment: CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}' - - name: with dashboard enabled - when: dashboard_enabled | bool + - name: With dashboard enabled + when: dashboard_enabled | bool and groups.get(monitoring_group_name, []) | length > 0 block: - name: Update the placement of alertmanager hosts ceph_orch_apply: @@ -1528,6 +1528,7 @@ service_id: "{{ ansible_facts['hostname'] }}" placement: label: "{{ monitoring_group_name }}" + count: "{{ groups.get(monitoring_group_name, []) | length }}" {% if grafana_server_addr is defined %} networks: - {{ grafana_server_addr }} @@ -1542,10 +1543,6 @@ environment: CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}' -<<<<<<< HEAD - - name: update the placement of prometheus hosts - command: "{{ cephadm_cmd }} shell -k /etc/ceph/{{ cluster }}.client.admin.keyring --fsid {{ fsid }} -- ceph orch apply prometheus --placement='{{ groups.get(monitoring_group_name, []) | length }} label:{{ monitoring_group_name }}'" -======= - name: Update the placement of prometheus hosts ceph_orch_apply: fsid: "{{ fsid }}" @@ -1559,7 +1556,6 @@ spec: port: {{ prometheus_port }} {% endif %} ->>>>>>> b41b7bf86 (cephadm-adopt: custom prometheus port lost after adoption) changed_when: false environment: CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'