Merge "Introducing tripleo_delegate_to on ceph health validation"
This commit is contained in:
commit
625c3cef85
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
- hosts: Controller
|
- hosts: ceph_mon
|
||||||
vars:
|
vars:
|
||||||
metadata:
|
metadata:
|
||||||
name: Check the status of the ceph cluster
|
name: Check the status of the ceph cluster
|
||||||
|
@ -10,6 +10,7 @@
|
||||||
groups:
|
groups:
|
||||||
- post-deployment
|
- post-deployment
|
||||||
- post-ceph
|
- post-ceph
|
||||||
|
tripleo_delegate_to: "{{ groups['ceph_mon'] | default([]) }}"
|
||||||
osd_percentage_min: 0
|
osd_percentage_min: 0
|
||||||
tasks:
|
tasks:
|
||||||
- include_role:
|
- include_role:
|
||||||
|
|
|
@ -4,3 +4,4 @@ fail_without_deps: false
|
||||||
fail_on_ceph_health_err: false
|
fail_on_ceph_health_err: false
|
||||||
osd_percentage_min: 0
|
osd_percentage_min: 0
|
||||||
ceph_ansible_repo: "centos-ceph-nautilus"
|
ceph_ansible_repo: "centos-ceph-nautilus"
|
||||||
|
container_client: "podman"
|
||||||
|
|
|
@ -5,12 +5,25 @@
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
register: ceph_mon_enabled
|
register: ceph_mon_enabled
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
delegate_to: "{{ tripleo_delegate_to | first | default(omit) }}"
|
||||||
|
|
||||||
- when: "ceph_mon_enabled is succeeded"
|
- when: "ceph_mon_enabled is succeeded"
|
||||||
|
delegate_to: "{{ tripleo_delegate_to | first | default(omit) }}"
|
||||||
block:
|
block:
|
||||||
- name: Set container_cli fact from the inventory
|
- 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:
|
set_fact:
|
||||||
container_cli: "{{ hostvars[inventory_hostname].container_cli|default('podman') }}"
|
container_client: |-
|
||||||
|
{% set container_cli = 'podman' %}
|
||||||
|
{% if check_docker_cli.stat.exists|bool %}
|
||||||
|
{% set container_client = 'docker' %}
|
||||||
|
{% endif %}
|
||||||
|
{{ container_client }}
|
||||||
|
|
||||||
- name: Set container filter format
|
- name: Set container filter format
|
||||||
set_fact:
|
set_fact:
|
||||||
|
@ -18,7 +31,7 @@
|
||||||
|
|
||||||
- name: Set ceph_mon_container name
|
- name: Set ceph_mon_container name
|
||||||
become: true
|
become: true
|
||||||
shell: "{{ container_cli }} ps {{ container_filter_format }} | grep ceph-mon"
|
shell: "{{ container_client }} ps {{ container_filter_format }} | grep ceph-mon"
|
||||||
register: ceph_mon_container
|
register: ceph_mon_container
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
|
@ -30,7 +43,7 @@
|
||||||
|
|
||||||
- name: Get ceph health
|
- name: Get ceph health
|
||||||
become: true
|
become: true
|
||||||
shell: "{{ container_cli }} exec {{ ceph_mon_container.stdout }} ceph --cluster {{ ceph_cluster_name.stdout }} health | awk '{print $1}'"
|
shell: "{{ container_client }} exec {{ ceph_mon_container.stdout }} ceph --cluster {{ ceph_cluster_name.stdout }} health | awk '{print $1}'"
|
||||||
register: ceph_health
|
register: ceph_health
|
||||||
|
|
||||||
- name: Check ceph health
|
- name: Check ceph health
|
||||||
|
@ -57,7 +70,7 @@
|
||||||
- name: Get OSD stat percentage
|
- name: Get OSD stat percentage
|
||||||
become: true
|
become: true
|
||||||
shell: >-
|
shell: >-
|
||||||
"{{ container_cli }}" exec "{{ ceph_mon_container.stdout }}" ceph
|
"{{ container_client }}" exec "{{ ceph_mon_container.stdout }}" ceph
|
||||||
--cluster "{{ ceph_cluster_name.stdout }}" osd stat -f json | jq '{{ jq_osd_percentage_filter }}'
|
--cluster "{{ ceph_cluster_name.stdout }}" osd stat -f json | jq '{{ jq_osd_percentage_filter }}'
|
||||||
register: ceph_osd_in_percentage
|
register: ceph_osd_in_percentage
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue