From 39d8a8de48afbfcdeaf74b066117260017fbaa22 Mon Sep 17 00:00:00 2001 From: Fernando Diaz Date: Thu, 13 Apr 2023 13:36:11 +0200 Subject: [PATCH] Adapt cepth health validation to the new API The API for health verification and OSD stats has changed in wallaby, now it is used cephadm command instead of connecting to the ceph mon container. This patch adapts the validation to the new API Resolves: rhbz#2187307 Change-Id: Ibfd143149b641304a8bb4baefc4d0c4f20457efd (cherry picked from commit e427f2e9acaa3b3fe18faf3c37e8ff29a8b325d5) --- roles/ceph/tasks/ceph-health.yaml | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/roles/ceph/tasks/ceph-health.yaml b/roles/ceph/tasks/ceph-health.yaml index fa59a7f60..5a9273200 100644 --- a/roles/ceph/tasks/ceph-health.yaml +++ b/roles/ceph/tasks/ceph-health.yaml @@ -10,31 +10,6 @@ - when: "ceph_mon_enabled is succeeded" delegate_to: "{{ tripleo_delegate_to | first | default(omit) }}" block: - - name: Check for docker cli - stat: - path: "/var/run/docker.sock" - register: check_docker_cli - check_mode: false - - - name: Set container_client fact - set_fact: - container_client: |- - {% set container_client = 'podman' %} - {% if check_docker_cli.stat.exists|bool %} - {% set container_client = 'docker' %} - {% endif %} - {{ container_client }} - - - name: Set container filter format - set_fact: - container_filter_format: !unsafe "--format '{{ .Names }}'" - - - name: Set ceph_mon_container name - become: true - shell: "{{ container_client }} ps {{ container_filter_format }} | grep ceph-mon" - register: ceph_mon_container - changed_when: false - - name: Set ceph cluster name become: true shell: find /etc/ceph -name '*.conf' -prune -print -quit | xargs basename -s '.conf' @@ -43,7 +18,7 @@ - name: Get ceph health become: true - shell: "{{ container_client }} exec {{ ceph_mon_container.stdout }} ceph --cluster {{ ceph_cluster_name.stdout }} health | awk '{print $1}'" + shell: "cephadm shell -- {{ ceph_cluster_name.stdout }} health" register: ceph_health - name: Check ceph health @@ -79,8 +54,8 @@ - name: Get OSD stat percentage become: true shell: >- - "{{ container_client }}" exec "{{ ceph_mon_container.stdout }}" ceph - --cluster "{{ ceph_cluster_name.stdout }}" osd stat -f json | jq '{{ jq_osd_percentage_filter }}' + cephadm shell -- "{{ ceph_cluster_name.stdout }}" + osd stat -f json | jq '{{ jq_osd_percentage_filter }}' register: ceph_osd_in_percentage - name: Fail if there is an unacceptable percentage of in OSDs