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 e427f2e9ac)
This commit is contained in:
Fernando Diaz 2023-04-13 13:36:11 +02:00 committed by Fernando Díaz Bravo
parent 447bd2f9f8
commit 39d8a8de48
1 changed files with 3 additions and 28 deletions

View File

@ -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