tripleo-ansible/tripleo_ansible/roles/tripleo_cephadm/tasks/post.yaml

49 lines
1.6 KiB
YAML

---
# Copyright 2021 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Get ceph_cli
include_tasks: ceph_cli.yaml
vars:
mount_spec: true
- name: Get the ceph orchestrator status
command: "{{ tripleo_cephadm_ceph_cli }} orch status --format json"
register: ceph_orch_status
become: true
- name: Fail if ceph orchestrator is not available
fail:
msg: "'ceph orch status' returned {{ ceph_orch_status.stdout | from_json }}"
when:
- not (ceph_orch_status.stdout | from_json).available
- name: Show the status of the resulting deployed Ceph cluster
block:
- name: Show the deployed daemons
command: "{{ tripleo_cephadm_ceph_cli }} orch ls --export"
become: true
register: ceph_orch_ls
- name: Deployed daemons
debug:
msg: "{{ ceph_orch_ls.stdout_lines }}"
- name: Print the status of the deployed Ceph cluster
command: "{{ tripleo_cephadm_ceph_cli }} -s"
become: true
register: ceph_health
- name: Ceph cluster status
debug:
msg: "{{ ceph_health.stdout_lines }}"