From 1f341e69d1f01023caf0985f4d46d8127d4753b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Wed, 25 Jul 2018 16:39:35 +0200 Subject: [PATCH] site: report ceph -s status at the end of the deployment MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We now show the output of 'ceph -s'. Example output below: TASK [display post install message] ********************************************************************************************************************************************************************************************************** ok: [localhost] => { "msg": [ " cluster:", " id: 753212df-f32a-4cc9-a097-2db6fe89a251", " health: HEALTH_OK", " ", " services:", " mon: 1 daemons, quorum ceph-nano-lul-faa32aebf00b", " mgr: ceph-nano-lul-faa32aebf00b(active)", " osd: 1 osds: 1 up, 1 in", " ", " data:", " pools: 4 pools, 32 pgs", " objects: 224 objects, 2546 bytes", " usage: 1027 MB used, 9212 MB / 10240 MB avail", " pgs: 32 active+clean", " " ] } Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1602910 Signed-off-by: Sébastien Han --- site-docker.yml.sample | 19 +++++++++++++++++++ site.yml.sample | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/site-docker.yml.sample b/site-docker.yml.sample index a11eee051..0878b3ddc 100644 --- a/site-docker.yml.sample +++ b/site-docker.yml.sample @@ -351,3 +351,22 @@ installer_phase_ceph_iscsi_gw: status: "Complete" end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" + +- hosts: mons + gather_facts: false + become: True + tasks: + - name: get ceph status from the first monitor + command: docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s + register: ceph_status + changed_when: false + delegate_to: "{{ groups['mons'][0] }}" + run_once: true + ignore_errors: true # we skip the error if mon_group_name is different than 'mons' + + - name: "show ceph status for cluster {{ cluster }}" + debug: + msg: "{{ ceph_status.stdout_lines }}" + delegate_to: "{{ groups['mons'][0] }}" + run_once: true + when: not ceph_status.failed \ No newline at end of file diff --git a/site.yml.sample b/site.yml.sample index fd4929724..f0f77dca4 100644 --- a/site.yml.sample +++ b/site.yml.sample @@ -386,3 +386,22 @@ installer_phase_ceph_iscsi_gw: status: "Complete" end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}" + +- hosts: mons + gather_facts: false + become: True + tasks: + - name: get ceph status from the first monitor + command: ceph --cluster {{ cluster }} -s + register: ceph_status + changed_when: false + delegate_to: "{{ groups['mons'][0] }}" + run_once: true + ignore_errors: true # we skip the error if mon_group_name is different than 'mons' + + - name: "show ceph status for cluster {{ cluster }}" + debug: + msg: "{{ ceph_status.stdout_lines }}" + delegate_to: "{{ groups['mons'][0] }}" + run_once: true + when: not ceph_status.failed \ No newline at end of file -- 2.39.5